﻿using System;
using System.Configuration;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.Extensions.Logging;
using orm.Utils.EFLogging;


// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled.
// If you have enabled NRTs for your project, then un-comment the following line:
// #nullable disable

namespace orm.Models
{
    public partial class OneSysDBContext : DbContext
    {
        private string _connectionString;

        public OneSysDBContext()
        {
            //这个地方是做手动migration时候使用的测试代码
            _connectionString = @"DataSource=..\projectdb.wdb";
        }

        public OneSysDBContext(string connectionString)
        {
            _connectionString = connectionString;
        }

        public OneSysDBContext(DbContextOptions<OneSysDBContext> options)
            : base(options)
        {
            
        }

        public virtual DbSet<TgsTDAcrule> TgsTDAcrule { get; set; }
        public virtual DbSet<TgsTDActivateData> TgsTDActivateData { get; set; }
        public virtual DbSet<TgsTDAnnotation> TgsTDAnnotation { get; set; }
        public virtual DbSet<TgsTDAnticolisionColor> TgsTDAnticolisionColor { get; set; }
        public virtual DbSet<TgsTDAnticollisionAlarm> TgsTDAnticollisionAlarm { get; set; }
        public virtual DbSet<TgsTDAnticollisionInfo> TgsTDAnticollisionInfo { get; set; }
        public virtual DbSet<TgsTDAnticollisionRule> TgsTDAnticollisionRule { get; set; }
        public virtual DbSet<TgsTDAssembly> TgsTDAssembly { get; set; }
        public virtual DbSet<TgsTDCase> TgsTDCase { get; set; }
        public virtual DbSet<TgsTDCheckShot> TgsTDCheckShot { get; set; }
        public virtual DbSet<TgsTDDataStructure> TgsTDDataStructure { get; set; }
        public virtual DbSet<TgsTDDatum> TgsTDDatum { get; set; }
        public virtual DbSet<TgsTDDefinitiveSurveyHeader> TgsTDDefinitiveSurveyHeader { get; set; }
        public virtual DbSet<TgsTDDefinitiveSurveyStation> TgsTDDefinitiveSurveyStation { get; set; }
        public virtual DbSet<TgsTDFault> TgsTDFault { get; set; }
        public virtual DbSet<TgsTDFile> TgsTDFile { get; set; }
        public virtual DbSet<TgsTDLine> TgsTDLine { get; set; }
        public virtual DbSet<TgsTDMagnetic> TgsTDMagnetic { get; set; }
        public virtual DbSet<TgsTDMagnetics> TgsTDMagnetics { get; set; }
        public virtual DbSet<TgsTDModel> TgsTDModel { get; set; }
        public virtual DbSet<TgsTDOffsetDesign> TgsTDOffsetDesign { get; set; }
        public virtual DbSet<TgsTDPoint> TgsTDPoint { get; set; }
        public virtual DbSet<TgsTDPolicy> TgsTDPolicy { get; set; }
        public virtual DbSet<TgsTDProject> TgsTDProject { get; set; }
        public virtual DbSet<TgsTDProjectAheadData> TgsTDProjectAheadData { get; set; }
        public virtual DbSet<TgsTDProjectTarget> TgsTDProjectTarget { get; set; }
        public virtual DbSet<TgsTDProjectTargetPoint> TgsTDProjectTargetPoint { get; set; }
        public virtual DbSet<TgsTDProjectTargetScenarioLink> TgsTDProjectTargetScenarioLink { get; set; }
        public virtual DbSet<TgsTDProjectTargetSiteLink> TgsTDProjectTargetSiteLink { get; set; }
        public virtual DbSet<TgsTDProjectTargetWblink> TgsTDProjectTargetWblink { get; set; }
        public virtual DbSet<TgsTDProjectTargetWellLink> TgsTDProjectTargetWellLink { get; set; }
        public virtual DbSet<TgsTDSectionSurveyHeader> TgsTDSectionSurveyHeader { get; set; }
        public virtual DbSet<TgsTDSesmic> TgsTDSesmic { get; set; }
        public virtual DbSet<TgsTDSite> TgsTDSite { get; set; }
        public virtual DbSet<TgsTDSlot> TgsTDSlot { get; set; }
        public virtual DbSet<TgsTDSlotData> TgsTDSlotData { get; set; }
        public virtual DbSet<TgsTDSlotTemplate> TgsTDSlotTemplate { get; set; }
        public virtual DbSet<TgsTDSurface> TgsTDSurface { get; set; }
        public virtual DbSet<TgsTDSurveyHeader> TgsTDSurveyHeader { get; set; }
        public virtual DbSet<TgsTDSurveyProgram> TgsTDSurveyProgram { get; set; }
        public virtual DbSet<TgsTDSurveyScenario> TgsTDSurveyScenario { get; set; }
        public virtual DbSet<TgsTDSurveyStation> TgsTDSurveyStation { get; set; }
        public virtual DbSet<TgsTDSurveytool> TgsTDSurveytool { get; set; }
        public virtual DbSet<TgsTDTarget> TgsTDTarget { get; set; }
        public virtual DbSet<TgsTDTargetInfo> TgsTDTargetInfo { get; set; }
        public virtual DbSet<TgsTDTargetPolygon> TgsTDTargetPolygon { get; set; }
        public virtual DbSet<TgsTDTcolor> TgsTDTcolor { get; set; }
        public virtual DbSet<TgsTDToolterm> TgsTDToolterm { get; set; }
        public virtual DbSet<TgsTDVerticalSection> TgsTDVerticalSection { get; set; }
        public virtual DbSet<TgsTDWalk> TgsTDWalk { get; set; }
        public virtual DbSet<TgsTDWell> TgsTDWell { get; set; }
        public virtual DbSet<TgsTDWellBasic> TgsTDWellBasic { get; set; }
        public virtual DbSet<TgsTDWellBore> TgsTDWellBore { get; set; }
        public virtual DbSet<TgsTDWellBoreType> TgsTDWellBoreType { get; set; }
        public virtual DbSet<TgsTDWellDatum> TgsTDWellDatum { get; set; }
        public virtual DbSet<TgsTDWellDatumDataSet> TgsTDWellDatumDataSet { get; set; }
        public virtual DbSet<TgsTDWellLocation> TgsTDWellLocation { get; set; }
        public DbSet<Orgnization> Orgnization { get; set; }

        protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
        {
            if (!optionsBuilder.IsConfigured)
            {

               
                var lf = new LoggerFactory();
                lf.AddProvider(new EFLoggerProvider());

               
                optionsBuilder.UseSqlite(_connectionString)
                    .UseLoggerFactory(lf)
                    .EnableSensitiveDataLogging();

            }
        }

        protected override void OnModelCreating(ModelBuilder modelBuilder)
        {

            modelBuilder.Entity<Orgnization>(entity =>
            {
                entity.ToView("OrgnizationView");
                entity.HasOne<Orgnization>(c => c.Parent)
                .WithMany(p => p.SubOrgs)
                .HasForeignKey("ParentId");
            });


            modelBuilder.Entity<TgsTDAcrule>(entity =>
            {
                entity.HasKey(e => e.Id0);

                entity.ToTable("TGS_T_D_ACRULE");

                entity.Property(e => e.Id0)
                    .HasColumnName("id0")
                    .ValueGeneratedNever();

                entity.Property(e => e.AcLimit).HasColumnName("ac_limit");

                entity.Property(e => e.AcProb).HasColumnName("ac_prob");

                entity.Property(e => e.AcRatio).HasColumnName("ac_ratio");

                entity.Property(e => e.AcruleId).HasColumnName("acrule_id");

                entity.Property(e => e.Color).HasColumnName("color");

                entity.Property(e => e.IsDefault).HasColumnName("is_default");

                entity.Property(e => e.PolicyId).HasColumnName("policy_id");

                entity.Property(e => e.RuleName).HasColumnName("rule_name");

                entity.Property(e => e.RuleType).HasColumnName("rule_type");

                entity.Property(e => e.SequenceNo).HasColumnName("sequence_no");
            });

            modelBuilder.Entity<TgsTDActivateData>(entity =>
            {
                entity.HasKey(e => e.Id0);

                entity.ToTable("TGS_T_D_ActivateData");

                entity.Property(e => e.Id0)
                    .HasColumnName("id0")
                    .ValueGeneratedNever();

                entity.Property(e => e.ActivateDataId).HasColumnName("activate_data_id");

                entity.Property(e => e.DataType).HasColumnName("data_type");
            });

            modelBuilder.Entity<TgsTDAnnotation>(entity =>
            {
                entity.HasKey(e => e.Id0);

                entity.ToTable("TGS_T_D_Annotation");

                entity.Property(e => e.Id0)
                    .HasColumnName("id0")
                    .ValueGeneratedNever();

                entity.Property(e => e.AnnoName).HasColumnName("anno_name");

                entity.Property(e => e.AnnotationId).HasColumnName("annotation_id");

                entity.Property(e => e.DepthType).HasColumnName("depth_type");

                entity.Property(e => e.Ew).HasColumnName("EW");

                entity.Property(e => e.Ns).HasColumnName("NS");

                entity.Property(e => e.PrognosedMd).HasColumnName("prognosed_md");

                entity.Property(e => e.PrognosedTvd).HasColumnName("prognosed_tvd");

                entity.Property(e => e.SurveyHeaderId).HasColumnName("survey_header_id");

                entity.Property(e => e.Vs).HasColumnName("VS");

                entity.Property(e => e.WellId).HasColumnName("well_id");

                entity.Property(e => e.WellboreId).HasColumnName("wellbore_id");
            });

            modelBuilder.Entity<TgsTDAnticolisionColor>(entity =>
            {
                entity.HasKey(e => e.Id0);

                entity.ToTable("TGS_T_D_AnticolisionColor");

                entity.Property(e => e.Id0)
                    .HasColumnName("id0")
                    .ValueGeneratedNever();

                entity.Property(e => e.Color).HasColumnName("color");

                entity.Property(e => e.DepthTo).HasColumnName("depth_to");

                entity.Property(e => e.DpColorId).HasColumnName("dp_color_id");

                entity.Property(e => e.MaxRadius).HasColumnName("max_radius");

                entity.Property(e => e.SequenceNo).HasColumnName("sequence_no");

                entity.Property(e => e.WellId).HasColumnName("well_id");

                entity.Property(e => e.WellboreId).HasColumnName("wellbore_id");
            });

            modelBuilder.Entity<TgsTDAnticollisionAlarm>(entity =>
            {
                entity.HasKey(e => e.Id0);

                entity.ToTable("TGS_T_D_AnticollisionAlarm");

                entity.Property(e => e.Id0)
                    .HasColumnName("id0")
                    .ValueGeneratedNever();

                entity.Property(e => e.NotifyCone).HasColumnName("notify_cone");

                entity.Property(e => e.NotifyMinimumSeparation).HasColumnName("notify_minimum_separation");

                entity.Property(e => e.NotifyOffsetScope).HasColumnName("notify_offset_scope");

                entity.Property(e => e.NotifyOffsetSidetrack).HasColumnName("notify_offset_sidetrack");

                entity.Property(e => e.NotifyProjectionLength).HasColumnName("notify_projection_length");

                entity.Property(e => e.NotifyProjectionType).HasColumnName("notify_projection_type");

                entity.Property(e => e.ProjectId).HasColumnName("project_id");

                entity.Property(e => e.UseSurfaceAnticollisionRule).HasColumnName("use_surface_anticollision_rule");
            });

            modelBuilder.Entity<TgsTDAnticollisionInfo>(entity =>
            {
                entity.HasKey(e => e.Id0);

                entity.ToTable("TGS_T_D_AnticollisionInfo");

                entity.Property(e => e.Id0)
                    .HasColumnName("id0")
                    .ValueGeneratedNever();

                entity.Property(e => e.ErrorModel).HasColumnName("error_model");

                entity.Property(e => e.ErrorOutputLevel).HasColumnName("error_output_level");

                entity.Property(e => e.ErrorSurface).HasColumnName("error_surface");

                entity.Property(e => e.ProjectId).HasColumnName("project_id");

                entity.Property(e => e.ScanMethod).HasColumnName("scan_method");

                entity.Property(e => e.UseCasing).HasColumnName("use_casing");

                entity.Property(e => e.WarnLevel).HasColumnName("warn_level");

                entity.Property(e => e.WarningMethod).HasColumnName("warning_method");
            });

            modelBuilder.Entity<TgsTDAnticollisionRule>(entity =>
            {
                entity.HasKey(e => e.Id0);

                entity.ToTable("TGS_T_D_AnticollisionRule");

                entity.Property(e => e.Id0)
                    .HasColumnName("id0")
                    .ValueGeneratedNever();

                entity.Property(e => e.AcLimit).HasColumnName("ac_limit");

                entity.Property(e => e.AcProb).HasColumnName("ac_prob");

                entity.Property(e => e.AcRatio).HasColumnName("ac_ratio");

                entity.Property(e => e.AcruleId).HasColumnName("acrule_id");

                entity.Property(e => e.IsDefault).HasColumnName("is_default");

                entity.Property(e => e.ProjectId).HasColumnName("project_id");

                entity.Property(e => e.RuleName).HasColumnName("rule_name");

                entity.Property(e => e.RuleType).HasColumnName("rule_type");
            });

            modelBuilder.Entity<TgsTDAssembly>(entity =>
            {
                entity.HasKey(e => e.Id0);

                entity.ToTable("TGS_T_D_ASSEMBLY");

                entity.Property(e => e.Id0)
                    .HasColumnName("id0")
                    .ValueGeneratedNever();

                entity.Property(e => e.AssemblyId).HasColumnName("assembly_id");

                entity.Property(e => e.AssemblyName).HasColumnName("assembly_name");

                entity.Property(e => e.AssemblyNo).HasColumnName("assembly_no");

                entity.Property(e => e.AssemblySize).HasColumnName("assembly_size");

                entity.Property(e => e.AssemblyType).HasColumnName("assembly_type");

                entity.Property(e => e.CasingCutOff).HasColumnName("casing_cut_off");

                entity.Property(e => e.CementDayNo).HasColumnName("cement_day_no");

                entity.Property(e => e.ConcentricAssemblyId).HasColumnName("concentric_assembly_id");

                entity.Property(e => e.ConcentricAssemblyWbId).HasColumnName("concentric_assembly_wb_id");

                entity.Property(e => e.CreateAppId).HasColumnName("create_app_id");

                entity.Property(e => e.CreateDate).HasColumnName("create_date");

                entity.Property(e => e.CreateUserId).HasColumnName("create_user_id");

                entity.Property(e => e.DateReport).HasColumnName("date_report");

                entity.Property(e => e.DesignLife).HasColumnName("design_life");

                entity.Property(e => e.EventId).HasColumnName("event_id");

                entity.Property(e => e.HoleSize).HasColumnName("hole_size");

                entity.Property(e => e.IdMin).HasColumnName("id_min");

                entity.Property(e => e.IsCasingLiner).HasColumnName("is_casing_liner");

                entity.Property(e => e.IsParallel).HasColumnName("is_parallel");

                entity.Property(e => e.IsTopDown).HasColumnName("is_top_down");

                entity.Property(e => e.LengthTotal).HasColumnName("length_total");

                entity.Property(e => e.MdAssemblyBase).HasColumnName("md_assembly_base");

                entity.Property(e => e.MdAssemblyTop).HasColumnName("md_assembly_top");

                entity.Property(e => e.MdSetDepthCorrection).HasColumnName("md_set_depth_correction");

                entity.Property(e => e.MdToc).HasColumnName("md_toc");

                entity.Property(e => e.MudDensityShoe).HasColumnName("mud_density_shoe");

                entity.Property(e => e.NoCompletionTrips).HasColumnName("no_completion_trips");

                entity.Property(e => e.OdMax).HasColumnName("od_max");

                entity.Property(e => e.Overlap).HasColumnName("overlap");

                entity.Property(e => e.Phase).HasColumnName("phase");

                entity.Property(e => e.PilotHoleSize).HasColumnName("pilot_hole_size");

                entity.Property(e => e.PipeRunId).HasColumnName("pipe_run_id");

                entity.Property(e => e.PlanDepthType).HasColumnName("plan_depth_type");

                entity.Property(e => e.Remarks).HasColumnName("remarks");

                entity.Property(e => e.ReportJournalId).HasColumnName("report_journal_id");

                entity.Property(e => e.RodLoadFactor).HasColumnName("rod_load_factor");

                entity.Property(e => e.RodSvcFactor).HasColumnName("rod_svc_factor");

                entity.Property(e => e.SandControlEquipment).HasColumnName("sand_control_equipment");

                entity.Property(e => e.SetDayNo).HasColumnName("set_day_no");

                entity.Property(e => e.StringClass).HasColumnName("string_class");

                entity.Property(e => e.StringType).HasColumnName("string_type");

                entity.Property(e => e.SuspPoint).HasColumnName("susp_point");

                entity.Property(e => e.SuspPointCorrection).HasColumnName("susp_point_correction");

                entity.Property(e => e.TvdAssemblyBase).HasColumnName("tvd_assembly_base");

                entity.Property(e => e.TvdAssemblyTop).HasColumnName("tvd_assembly_top");

                entity.Property(e => e.TvdToc).HasColumnName("tvd_toc");

                entity.Property(e => e.UpdateAppId).HasColumnName("update_app_id");

                entity.Property(e => e.UpdateDate).HasColumnName("update_date");

                entity.Property(e => e.UpdateUserId).HasColumnName("update_user_id");

                entity.Property(e => e.WeightAboveJars).HasColumnName("weight_above_jars");

                entity.Property(e => e.WeightBelowJars).HasColumnName("weight_below_jars");

                entity.Property(e => e.WellId).HasColumnName("well_id");

                entity.Property(e => e.WellboreId).HasColumnName("wellbore_id");
            });

            modelBuilder.Entity<TgsTDCase>(entity =>
            {
                entity.HasKey(e => e.Id0);

                entity.ToTable("TGS_T_D_CASE");

                entity.Property(e => e.Id0)
                    .HasColumnName("id0")
                    .ValueGeneratedNever();

                entity.Property(e => e.AssemblyId).HasColumnName("assembly_id");

                entity.Property(e => e.BlooieLineInnerDiameter).HasColumnName("blooie_line_inner_diameter");

                entity.Property(e => e.BlooieLineLength).HasColumnName("blooie_line_length");

                entity.Property(e => e.CaseAuthor).HasColumnName("case_author");

                entity.Property(e => e.CaseDescription).HasColumnName("case_description");

                entity.Property(e => e.CaseId).HasColumnName("case_id");

                entity.Property(e => e.CaseName).HasColumnName("case_name");

                entity.Property(e => e.ContractorId).HasColumnName("contractor_id");

                entity.Property(e => e.CreateAppId).HasColumnName("create_app_id");

                entity.Property(e => e.CreateDate).HasColumnName("create_date");

                entity.Property(e => e.CreateUserId).HasColumnName("create_user_id");

                entity.Property(e => e.DatumId).HasColumnName("datum_id");

                entity.Property(e => e.DrillDepthRating).HasColumnName("drill_depth_rating");

                entity.Property(e => e.FluidId).HasColumnName("fluid_id");

                entity.Property(e => e.HoleSectGroupId).HasColumnName("hole_sect_group_id");

                entity.Property(e => e.InnerAssemblyId).HasColumnName("inner_assembly_id");

                entity.Property(e => e.IsLinked).HasColumnName("is_linked");

                entity.Property(e => e.IsReadonly).HasColumnName("is_readonly");

                entity.Property(e => e.JobDate).HasColumnName("job_date");

                entity.Property(e => e.JobDescription).HasColumnName("job_description");

                entity.Property(e => e.JobPipeSize).HasColumnName("job_pipe_size");

                entity.Property(e => e.JobRepresentative).HasColumnName("job_representative");

                entity.Property(e => e.LastCatalogId).HasColumnName("last_catalog_id");

                entity.Property(e => e.NumWallplots).HasColumnName("num_wallplots");

                entity.Property(e => e.ParentCaseId).HasColumnName("parent_case_id");

                entity.Property(e => e.Phase).HasColumnName("phase");

                entity.Property(e => e.Remarks).HasColumnName("remarks");

                entity.Property(e => e.RigCapacity).HasColumnName("rig_capacity");

                entity.Property(e => e.RigId).HasColumnName("rig_id");

                entity.Property(e => e.SalesOrderNumber).HasColumnName("sales_order_number");

                entity.Property(e => e.ScenarioId).HasColumnName("scenario_id");

                entity.Property(e => e.SequenceNo).HasColumnName("sequence_no");

                entity.Property(e => e.SpAddress).HasColumnName("sp_address");

                entity.Property(e => e.SpCompany).HasColumnName("sp_company");

                entity.Property(e => e.SpRepresentative).HasColumnName("sp_representative");

                entity.Property(e => e.SpTelephone).HasColumnName("sp_telephone");

                entity.Property(e => e.UpdateAppId).HasColumnName("update_app_id");

                entity.Property(e => e.UpdateDate).HasColumnName("update_date");

                entity.Property(e => e.UpdateUserId).HasColumnName("update_user_id");

                entity.Property(e => e.UseRigCapacity).HasColumnName("use_rig_capacity");

                entity.Property(e => e.WellId).HasColumnName("well_id");

                entity.Property(e => e.WellboreId).HasColumnName("wellbore_id");
            });

            modelBuilder.Entity<TgsTDCheckShot>(entity =>
            {
                entity.HasKey(e => e.Id0);

                entity.ToTable("TGS_T_D_CheckShot");

                entity.Property(e => e.Id0)
                    .HasColumnName("id0")
                    .ValueGeneratedNever();
            });

            modelBuilder.Entity<TgsTDDataStructure>(entity =>
            {
                entity.HasKey(e => e.Id0);

                entity.ToTable("TGS_T_D_DataStructure");

                entity.Property(e => e.Id0)
                    .HasColumnName("id0")
                    .ValueGeneratedNever();

                entity.Property(e => e.DataType).HasColumnName("dataType");

                entity.Property(e => e.ParentId).HasColumnName("parent_id");

                entity.Property(e => e.SourceId)
                    .IsRequired()
                    .HasColumnName("source_id");
            });

            modelBuilder.Entity<TgsTDDatum>(entity =>
            {
                entity.HasKey(e => e.Id0);

                entity.ToTable("TGS_T_D_Datum");

                entity.Property(e => e.Id0)
                    .HasColumnName("id0")
                    .ValueGeneratedNever();

                entity.Property(e => e.BlueWaterdepth).HasColumnName("blue_waterdepth");

                entity.Property(e => e.DatumType).HasColumnName("datum_type");

                entity.Property(e => e.DatumnId).HasColumnName("datumn_id");

                entity.Property(e => e.GroundEvation).HasColumnName("ground_evation");

                entity.Property(e => e.InshoreDepth).HasColumnName("inshore_depth");

                entity.Property(e => e.WellId).HasColumnName("well_id");

                entity.Property(e => e.WellheadDepth).HasColumnName("wellhead_depth");

                entity.Property(e => e.WellheadHeight).HasColumnName("wellhead_height");

                entity.Property(e => e.WellheadTvd).HasColumnName("wellhead_tvd");
            });

            modelBuilder.Entity<TgsTDDefinitiveSurveyHeader>(entity =>
            {
                entity.HasKey(e => e.Id0);

                entity.ToTable("TGS_T_D_DefinitiveSurveyHeader");

                entity.Property(e => e.Id0)
                    .HasColumnName("id0")
                    .ValueGeneratedNever();

                entity.Property(e => e.AcscanMdMax).HasColumnName("acscan_md_max");

                entity.Property(e => e.AcscanMdMin).HasColumnName("acscan_md_min");

                entity.Property(e => e.AcscanRadiusMax).HasColumnName("acscan_radius_max");

                entity.Property(e => e.AcscanRatioMax).HasColumnName("acscan_ratio_max");

                entity.Property(e => e.AverageDogleg).HasColumnName("average_dogleg");

                entity.Property(e => e.BInterp)
                    .HasColumnName("b_interp")
                    .HasColumnType("BIT");

                entity.Property(e => e.BRange)
                    .HasColumnName("b_range")
                    .HasColumnType("BIT");

                entity.Property(e => e.BRatio)
                    .HasColumnName("b_ratio")
                    .HasColumnType("BIT");

                entity.Property(e => e.BhMd).HasColumnName("bh_md");

                entity.Property(e => e.BhTvd).HasColumnName("bh_tvd");

                entity.Property(e => e.CreateAppId).HasColumnName("create_app_id");

                entity.Property(e => e.CreateDate).HasColumnName("create_date");

                entity.Property(e => e.CreateUserId).HasColumnName("create_user_id");

                entity.Property(e => e.DefSurveyHeaderId).HasColumnName("def_survey_header_id");

                entity.Property(e => e.DefinitivePath)
                    .HasColumnName("definitive_path")
                    .HasColumnType("BIT");

                entity.Property(e => e.DefinitiveVersion).HasColumnName("definitive_version");

                entity.Property(e => e.Description).HasColumnName("description");

                entity.Property(e => e.DirectionalDifficultyIndex).HasColumnName("directional_difficulty_index");

                entity.Property(e => e.EffectiveDate).HasColumnName("effective_date");

                entity.Property(e => e.FinalEast).HasColumnName("final_east");

                entity.Property(e => e.FinalError).HasColumnName("final_error");

                entity.Property(e => e.FinalNorth).HasColumnName("final_north");

                entity.Property(e => e.Interpolate)
                    .HasColumnName("interpolate")
                    .HasColumnType("BIT");

                entity.Property(e => e.InterpolationInterval).HasColumnName("interpolation_interval");

                entity.Property(e => e.IsDefinitive)
                    .HasColumnName("is_definitive")
                    .HasColumnType("BIT");

                entity.Property(e => e.IsReadonly)
                    .HasColumnName("is_readonly")
                    .HasColumnType("BIT");

                entity.Property(e => e.IsSurveyProgramReadOnly)
                    .HasColumnName("is_survey_program_read_only")
                    .HasColumnType("BIT");

                entity.Property(e => e.KoEast).HasColumnName("ko_east");

                entity.Property(e => e.KoMd).HasColumnName("ko_md");

                entity.Property(e => e.KoNorth).HasColumnName("ko_north");

                entity.Property(e => e.KoTvd).HasColumnName("ko_tvd");

                entity.Property(e => e.MaximumDlsDepth).HasColumnName("maximum_dls_depth");

                entity.Property(e => e.MaximumDlsValue).HasColumnName("maximum_dls_value");

                entity.Property(e => e.Name).HasColumnName("name");

                entity.Property(e => e.Phase).HasColumnName("phase");

                entity.Property(e => e.PlannedAzimuth).HasColumnName("planned_azimuth");

                entity.Property(e => e.Remarks).HasColumnName("remarks");

                entity.Property(e => e.Tortuosity).HasColumnName("tortuosity");

                entity.Property(e => e.TortuosityPeriod).HasColumnName("tortuosity_period");

                entity.Property(e => e.TortuosityType).HasColumnName("tortuosity_type");

                entity.Property(e => e.UpdateAppId).HasColumnName("update_app_id");

                entity.Property(e => e.UpdateDate).HasColumnName("update_date");

                entity.Property(e => e.UpdateUserId).HasColumnName("update_user_id");

                entity.Property(e => e.UseActualData)
                    .HasColumnName("use_actual_data")
                    .HasColumnType("BIT");

                entity.Property(e => e.UsePlannedProgram)
                    .HasColumnName("use_planned_program")
                    .HasColumnType("BIT");

                entity.Property(e => e.Version).HasColumnName("version");

                entity.Property(e => e.VsEast).HasColumnName("vs_east");

                entity.Property(e => e.VsNorth).HasColumnName("vs_north");

                entity.Property(e => e.WellId).HasColumnName("well_id");

                entity.Property(e => e.WellboreId).HasColumnName("wellbore_id");
            });

            modelBuilder.Entity<TgsTDDefinitiveSurveyStation>(entity =>
            {
                entity.HasKey(e => e.Id0);

                entity.ToTable("TGS_T_D_DefinitiveSurveyStation");

                entity.HasIndex(e => e.DefSurveyHeaderId)
                    .HasName("def_survey_header");

                entity.Property(e => e.Id0)
                    .HasColumnName("id0")
                    .ValueGeneratedNever();

                entity.Property(e => e.Azimuth).HasColumnName("azimuth");

                entity.Property(e => e.BuildRate).HasColumnName("build_rate");

                entity.Property(e => e.CasingRadius).HasColumnName("casing_radius");

                entity.Property(e => e.CovarianceXx).HasColumnName("covariance_xx");

                entity.Property(e => e.CovarianceXy).HasColumnName("covariance_xy");

                entity.Property(e => e.CovarianceXz).HasColumnName("covariance_xz");

                entity.Property(e => e.CovarianceYy).HasColumnName("covariance_yy");

                entity.Property(e => e.CovarianceYz).HasColumnName("covariance_yz");

                entity.Property(e => e.CovarianceZz).HasColumnName("covariance_zz");

                entity.Property(e => e.DataEntryMode)
                    .HasColumnName("data_entry_mode")
                    .HasColumnType("BIT");

                entity.Property(e => e.DefSurveyHeaderId).HasColumnName("def_survey_header_id");

                entity.Property(e => e.DefinitiveSurveyId).HasColumnName("definitive_survey_id");

                entity.Property(e => e.DoglegSeverity).HasColumnName("dogleg_severity");

                entity.Property(e => e.DoglegSeverityMax).HasColumnName("dogleg_severity_max");

                entity.Property(e => e.EllipseEast).HasColumnName("ellipse_east");

                entity.Property(e => e.EllipseNorth).HasColumnName("ellipse_north");

                entity.Property(e => e.EllipseVertical).HasColumnName("ellipse_vertical");

                entity.Property(e => e.GlobalLateralError).HasColumnName("global_lateral_error");

                entity.Property(e => e.Inclination).HasColumnName("inclination");

                entity.Property(e => e.Md).HasColumnName("md");

                entity.Property(e => e.OffsetEast).HasColumnName("offset_east");

                entity.Property(e => e.OffsetNorth).HasColumnName("offset_north");

                entity.Property(e => e.SequenceNo).HasColumnName("sequence_no");

                entity.Property(e => e.ToolFaceAngle).HasColumnName("tool_face_angle");

                entity.Property(e => e.TurnRate).HasColumnName("turn_rate");

                entity.Property(e => e.Tvd).HasColumnName("tvd");

                entity.Property(e => e.VerticalSect).HasColumnName("vertical_sect");

                entity.Property(e => e.WellId).HasColumnName("well_id");

                entity.Property(e => e.WellboreId).HasColumnName("wellbore_id");
            });

            modelBuilder.Entity<TgsTDFault>(entity =>
            {
                entity.HasKey(e => e.Id0);

                entity.ToTable("TGS_T_D_Fault");

                entity.Property(e => e.Id0)
                    .HasColumnName("id0")
                    .ValueGeneratedNever();

                entity.Property(e => e.FaultGuid).HasColumnName("fault_guid");

                entity.Property(e => e.LineNo).HasColumnName("line_no");

                entity.Property(e => e.Twt).HasColumnName("twt");

                entity.Property(e => e.Undefined1).HasColumnName("undefined1");

                entity.Property(e => e.Undefined2).HasColumnName("undefined2");

                entity.Property(e => e.Undefined3).HasColumnName("undefined3");

                entity.Property(e => e.X).HasColumnName("x");

                entity.Property(e => e.Y).HasColumnName("y");

                entity.Property(e => e.Z).HasColumnName("z");
            });

            modelBuilder.Entity<TgsTDFile>(entity =>
            {
                entity.HasKey(e => e.Id0);

                entity.ToTable("TGS_T_D_File");

                entity.Property(e => e.Id0)
                    .HasColumnName("id0")
                    .ValueGeneratedNever();

                entity.Property(e => e.Guid).HasColumnName("guid");

                entity.Property(e => e.Path).HasColumnName("path");
            });

            modelBuilder.Entity<TgsTDLine>(entity =>
            {
                entity.HasKey(e => e.Id0);

                entity.ToTable("TGS_T_D_Line");

                entity.Property(e => e.Id0)
                    .HasColumnName("id0")
                    .ValueGeneratedNever();

                entity.Property(e => e.LineGuid).HasColumnName("line_guid");

                entity.Property(e => e.Version).HasColumnName("version");

                entity.Property(e => e.X).HasColumnName("x");

                entity.Property(e => e.Y).HasColumnName("y");

                entity.Property(e => e.Z).HasColumnName("z");
            });

            modelBuilder.Entity<TgsTDMagnetic>(entity =>
            {
                entity.HasKey(e => e.Id0);

                entity.ToTable("TGS_T_D_Magnetic");

                entity.Property(e => e.Id0)
                    .HasColumnName("id0")
                    .ValueGeneratedNever();

                entity.Property(e => e.Declination).HasColumnName("declination");

                entity.Property(e => e.DeclinationDate).HasColumnName("declination_date");

                entity.Property(e => e.DipAngle).HasColumnName("dip_angle");

                entity.Property(e => e.FieldStrength).HasColumnName("field_strength");

                entity.Property(e => e.MagneticModelId).HasColumnName("magnetic_model_id");

                entity.Property(e => e.ModelName).HasColumnName("model_name");

                entity.Property(e => e.SequenceNo).HasColumnName("sequence_no");

                entity.Property(e => e.WellId).HasColumnName("well_id");

                entity.Property(e => e.WellboreId).HasColumnName("wellbore_id");
            });

            modelBuilder.Entity<TgsTDMagnetics>(entity =>
            {
                entity.HasNoKey();

                entity.ToTable("TGS_T_D_Magnetics");

                entity.Property(e => e.Declination).HasColumnName("declination");

                entity.Property(e => e.DeclinationDate).HasColumnName("declination_date");

                entity.Property(e => e.DipAngle).HasColumnName("dip_angle");

                entity.Property(e => e.FieldStrength).HasColumnName("field_strength");

                entity.Property(e => e.MagneticModelId).HasColumnName("magnetic_model_id");

                entity.Property(e => e.SequenceNo).HasColumnName("sequence_no");

                entity.Property(e => e.WellId).HasColumnName("well_id");

                entity.Property(e => e.WellboreId).HasColumnName("wellbore_id");
            });

            modelBuilder.Entity<TgsTDModel>(entity =>
            {
                entity.HasKey(e => e.Id0);

                entity.ToTable("TGS_T_D_Model");

                entity.Property(e => e.Id0)
                    .HasColumnName("id0")
                    .ValueGeneratedNever();

                entity.Property(e => e.Guid).HasColumnName("guid");

                entity.Property(e => e.Path).HasColumnName("path");
            });

            modelBuilder.Entity<TgsTDOffsetDesign>(entity =>
            {
                entity.HasKey(e => e.Id0);

                entity.ToTable("TGS_T_D_OffsetDesign");

                entity.Property(e => e.Id0)
                    .HasColumnName("id0")
                    .ValueGeneratedNever();

                entity.Property(e => e.WellId).HasColumnName("well_id");

                entity.Property(e => e.WellboreId).HasColumnName("wellbore_id");
            });

            modelBuilder.Entity<TgsTDPoint>(entity =>
            {
                entity.HasKey(e => e.Id0);

                entity.ToTable("TGS_T_D_Point");

                entity.Property(e => e.Id0)
                    .HasColumnName("id0")
                    .ValueGeneratedNever();

                entity.Property(e => e.Version).HasColumnName("version");

                entity.Property(e => e.X).HasColumnName("x");

                entity.Property(e => e.Y).HasColumnName("y");

                entity.Property(e => e.Z).HasColumnName("z");
            });

            modelBuilder.Entity<TgsTDPolicy>(entity =>
            {
                entity.HasKey(e => e.Id0);

                entity.ToTable("TGS_T_D_POLICY");

                entity.Property(e => e.Id0)
                    .HasColumnName("id0")
                    .ValueGeneratedNever();

                entity.Property(e => e.AttachmentJournalId).HasColumnName("attachment_journal_id");

                entity.Property(e => e.BaCode).HasColumnName("ba_code");

                entity.Property(e => e.ChecksumValue).HasColumnName("checksum_value");

                entity.Property(e => e.ContingencyCodes).HasColumnName("contingency_codes");

                entity.Property(e => e.ContingencyInfo).HasColumnName("contingency_info");

                entity.Property(e => e.CreateAppId).HasColumnName("create_app_id");

                entity.Property(e => e.CreateDate).HasColumnName("create_date");

                entity.Property(e => e.CreateUserId).HasColumnName("create_user_id");

                entity.Property(e => e.CustomerAddress).HasColumnName("customer_address");

                entity.Property(e => e.CustomerDivision).HasColumnName("customer_division");

                entity.Property(e => e.CustomerGroup).HasColumnName("customer_group");

                entity.Property(e => e.CustomerName).HasColumnName("customer_name");

                entity.Property(e => e.CustomerRepresentative).HasColumnName("customer_representative");

                entity.Property(e => e.CustomerTelephone).HasColumnName("customer_telephone");

                entity.Property(e => e.ErrorLevel).HasColumnName("error_level");

                entity.Property(e => e.ErrorModel).HasColumnName("error_model");

                entity.Property(e => e.ErrorOutputLevel).HasColumnName("error_output_level");

                entity.Property(e => e.ErrorSurface).HasColumnName("error_surface");

                entity.Property(e => e.IsContingencyCalc)
                    .HasColumnName("is_contingency_calc")
                    .HasColumnType("BIT");

                entity.Property(e => e.IsDualCurrency).HasColumnName("is_dual_currency");

                entity.Property(e => e.IsReadonly).HasColumnName("is_readonly");

                entity.Property(e => e.NotifyCone).HasColumnName("notify_cone");

                entity.Property(e => e.NotifyMinimumSeparation).HasColumnName("notify_minimum_separation");

                entity.Property(e => e.NotifyOffsetScope).HasColumnName("notify_offset_scope");

                entity.Property(e => e.NotifyOffsetSidetrack).HasColumnName("notify_offset_sidetrack");

                entity.Property(e => e.NotifyProjectionLength).HasColumnName("notify_projection_length");

                entity.Property(e => e.NotifyProjectionType).HasColumnName("notify_projection_type");

                entity.Property(e => e.Password1).HasColumnName("password_1");

                entity.Property(e => e.Password2).HasColumnName("password_2");

                entity.Property(e => e.PolicyId).HasColumnName("policy_id");

                entity.Property(e => e.Remarks).HasColumnName("remarks");

                entity.Property(e => e.ReportingStandard).HasColumnName("reporting_standard");

                entity.Property(e => e.ReportingTime).HasColumnName("reporting_time");

                entity.Property(e => e.ScanMethod).HasColumnName("scan_method");

                entity.Property(e => e.SurveyCalc).HasColumnName("survey_calc");

                entity.Property(e => e.TemplateId).HasColumnName("template_id");

                entity.Property(e => e.UpdateAppId).HasColumnName("update_app_id");

                entity.Property(e => e.UpdateDate).HasColumnName("update_date");

                entity.Property(e => e.UpdateUserId).HasColumnName("update_user_id");

                entity.Property(e => e.UseCasing).HasColumnName("use_casing");

                entity.Property(e => e.UseSurfaceAnticollisionRule).HasColumnName("use_surface_anticollision_rule");

                entity.Property(e => e.VsOrigin).HasColumnName("vs_origin");

                entity.Property(e => e.WalkType).HasColumnName("walk_type");

                entity.Property(e => e.WarningMethod).HasColumnName("warning_method");
            });

            modelBuilder.Entity<TgsTDProject>(entity =>
            {
                entity.HasKey(e => e.Id0);

                entity.ToTable("TGS_T_D_Project");

                entity.Property(e => e.Id0)
                    .HasColumnName("id0")
                    .ValueGeneratedNever();

                entity.Property(e => e.ActiveUiUnitsysId).HasColumnName("active_ui_unitsys_id");

                entity.Property(e => e.BasinName).HasColumnName("basin_name");

                entity.Property(e => e.CreateAppId).HasColumnName("create_app_id");

                entity.Property(e => e.CreateDate).HasColumnName("create_date");

                entity.Property(e => e.CreateUserId).HasColumnName("create_user_id");

                entity.Property(e => e.DefMagModel).HasColumnName("def_mag_model");

                entity.Property(e => e.Description).HasColumnName("description");

                entity.Property(e => e.DescriptionSupplement).HasColumnName("description_supplement");

                entity.Property(e => e.EpsgId).HasColumnName("Epsg_Id");

                entity.Property(e => e.FieldNo).HasColumnName("field_no");

                entity.Property(e => e.GeoDatumId).HasColumnName("geo_datum_id");

                entity.Property(e => e.GeoSystemId).HasColumnName("geo_system_id");

                entity.Property(e => e.GeoZoneId).HasColumnName("geo_zone_id");

                entity.Property(e => e.IsFacility)
                    .HasColumnName("is_facility")
                    .HasColumnType("BIT");

                entity.Property(e => e.IsProjectReadonly).HasColumnName("is_project_readonly");

                entity.Property(e => e.IsReadonly)
                    .HasColumnName("is_readonly")
                    .HasColumnType("BIT");

                entity.Property(e => e.LocalCoordOrigin).HasColumnName("local_coord_origin");

                entity.Property(e => e.MagCalcModel).HasColumnName("mag_calc_model");

                entity.Property(e => e.PolicyId).HasColumnName("policy_id");

                entity.Property(e => e.ProjectCode).HasColumnName("project_code");

                entity.Property(e => e.ProjectId).HasColumnName("project_id");

                entity.Property(e => e.ProjectName).HasColumnName("project_name");

                entity.Property(e => e.ProjectPassword).HasColumnName("project_password");

                entity.Property(e => e.Remarks).HasColumnName("remarks");

                entity.Property(e => e.RiskDepth).HasColumnName("risk_depth");

                entity.Property(e => e.RiskFactor).HasColumnName("risk_factor");

                entity.Property(e => e.StateNo).HasColumnName("state_no");

                entity.Property(e => e.SystemDatumDesc).HasColumnName("system_datum_desc");

                entity.Property(e => e.SystemDatumOffset).HasColumnName("system_datum_offset");

                entity.Property(e => e.SystemDatumType).HasColumnName("system_datum_type");

                entity.Property(e => e.TemplateId).HasColumnName("template_id");

                entity.Property(e => e.TightGroupId).HasColumnName("tight_group_id");

                entity.Property(e => e.TimeZone).HasColumnName("time_zone");

                entity.Property(e => e.TimeZoneDescription).HasColumnName("time_zone_description");

                entity.Property(e => e.UpdateAppId).HasColumnName("update_app_id");

                entity.Property(e => e.UpdateDate).HasColumnName("update_date");

                entity.Property(e => e.UpdateUserId).HasColumnName("update_user_id");

                entity.Property(e => e.UseGeodeticCoordinate).HasColumnName("useGeodeticCoordinate");

                entity.Property(e => e.UseLocalScaleFactor)
                    .HasColumnName("use_local_scale_factor")
                    .HasColumnType("BIT");

                entity.Property(e => e.UseRisk)
                    .HasColumnName("use_risk")
                    .HasColumnType("BIT");

                entity.Property(e => e.UseVariableConvergence)
                    .HasColumnName("use_variable_convergence")
                    .HasColumnType("BIT");

                entity.Property(e => e.VerticalCoordOrigin)
                    .HasColumnName("vertical_coord_origin")
                    .HasColumnType("BIT");
            });

            modelBuilder.Entity<TgsTDProjectAheadData>(entity =>
            {
                entity.HasKey(e => e.Id0);

                entity.ToTable("TGS_T_D_ProjectAheadData");

                entity.Property(e => e.Id0).HasColumnName("id0");

                entity.Property(e => e.CheckAzi).HasColumnName("CheckAZI");

                entity.Property(e => e.CheckInc).HasColumnName("CheckINC");

                entity.Property(e => e.CheckMd).HasColumnName("CheckMD");

                entity.Property(e => e.CheckTvd).HasColumnName("CheckTVD");

                entity.Property(e => e.ParamAzi).HasColumnName("ParamAZI");

                entity.Property(e => e.ParamEw).HasColumnName("ParamEW");

                entity.Property(e => e.ParamInc).HasColumnName("ParamINC");

                entity.Property(e => e.ParamMd).HasColumnName("ParamMD");

                entity.Property(e => e.ParamNs).HasColumnName("ParamNS");

                entity.Property(e => e.ParamTvd).HasColumnName("ParamTVD");

                entity.Property(e => e.ProjectAheadId).HasColumnName("ProjectAhead_id");

                entity.Property(e => e.SectionSurveyId).HasColumnName("section_survey_id");

                entity.Property(e => e.Smd).HasColumnName("SMD");

                entity.Property(e => e.SoffsetX).HasColumnName("SOffsetX");

                entity.Property(e => e.SoffsetY).HasColumnName("SOffsetY");

                entity.Property(e => e.Stvd).HasColumnName("STVD");

                entity.Property(e => e.SurveyId).HasColumnName("survey_id");

                entity.Property(e => e.TfpprjToPos).HasColumnName("TFPPrjToPos");

                entity.Property(e => e.TfpprjUseCurveType).HasColumnName("TFPPrjUseCurveType");

                entity.Property(e => e.WellboreId).HasColumnName("wellbore_id");
            });

            modelBuilder.Entity<TgsTDProjectTarget>(entity =>
            {
                entity.HasKey(e => e.Id0);

                entity.ToTable("TGS_T_D_ProjectTarget");

                entity.Property(e => e.Id0)
                    .HasColumnName("id0")
                    .ValueGeneratedNever();

                entity.Property(e => e.AlignTargetId).HasColumnName("align_target_id");

                entity.Property(e => e.ArcRadius).HasColumnName("arc_radius");

                entity.Property(e => e.AzimuthEnd).HasColumnName("azimuth_end");

                entity.Property(e => e.AzimuthStart).HasColumnName("azimuth_start");

                entity.Property(e => e.CoordType).HasColumnName("coord_type");

                entity.Property(e => e.CreateAppId).HasColumnName("create_app_id");

                entity.Property(e => e.CreateDate).HasColumnName("create_date");

                entity.Property(e => e.CreateUserId).HasColumnName("create_user_id");

                entity.Property(e => e.DipAngle).HasColumnName("dip_angle");

                entity.Property(e => e.DipDirection).HasColumnName("dip_direction");

                entity.Property(e => e.DrillConfidence).HasColumnName("drill_confidence");

                entity.Property(e => e.DrillDefSurveyHeaderId).HasColumnName("drill_def_survey_header_id");

                entity.Property(e => e.DrillTolerance).HasColumnName("drill_tolerance");

                entity.Property(e => e.DrillWellId).HasColumnName("drill_well_id");

                entity.Property(e => e.DrillWellboreId).HasColumnName("drill_wellbore_id");

                entity.Property(e => e.GeoLatitude).HasColumnName("geo_latitude");

                entity.Property(e => e.GeoLongitude).HasColumnName("geo_longitude");

                entity.Property(e => e.GeoMapEasting).HasColumnName("geo_map_easting");

                entity.Property(e => e.GeoMapNorthing).HasColumnName("geo_map_northing");

                entity.Property(e => e.GeoOffsetEastTarget).HasColumnName("geo_offset_east_target");

                entity.Property(e => e.GeoOffsetNorthTarget).HasColumnName("geo_offset_north_target");

                entity.Property(e => e.IsDrillersTarget).HasColumnName("is_drillers_target");

                entity.Property(e => e.IsPointMapCoordLock).HasColumnName("is_point_map_coord_lock");

                entity.Property(e => e.IsReadonly).HasColumnName("is_readonly");

                entity.Property(e => e.LastGoodCorrelationMd).HasColumnName("last_good_correlation_md");

                entity.Property(e => e.LockPenetration).HasColumnName("lock_penetration");

                entity.Property(e => e.PenetrationAzimuth).HasColumnName("penetration_azimuth");

                entity.Property(e => e.PenetrationInclination).HasColumnName("penetration_inclination");

                entity.Property(e => e.ProjectId).HasColumnName("project_id");

                entity.Property(e => e.ProjectTargetId).HasColumnName("project_target_id");

                entity.Property(e => e.SequenceNo).HasColumnName("sequence_no");

                entity.Property(e => e.TargetAzimuth).HasColumnName("target_azimuth");

                entity.Property(e => e.TargetDescription).HasColumnName("target_description");

                entity.Property(e => e.TargetGeometry).HasColumnName("target_geometry");

                entity.Property(e => e.TargetHide).HasColumnName("target_hide");

                entity.Property(e => e.TargetInclination).HasColumnName("target_inclination");

                entity.Property(e => e.TargetName).HasColumnName("target_name");

                entity.Property(e => e.TargetTvd).HasColumnName("target_tvd");

                entity.Property(e => e.TargetType).HasColumnName("target_type");

                entity.Property(e => e.ToleranceBack).HasColumnName("tolerance_back");

                entity.Property(e => e.ToleranceDown).HasColumnName("tolerance_down");

                entity.Property(e => e.ToleranceForward).HasColumnName("tolerance_forward");

                entity.Property(e => e.ToleranceHeading).HasColumnName("tolerance_heading");

                entity.Property(e => e.ToleranceLeft).HasColumnName("tolerance_left");

                entity.Property(e => e.ToleranceRight).HasColumnName("tolerance_right");

                entity.Property(e => e.ToleranceUp).HasColumnName("tolerance_up");

                entity.Property(e => e.UpdateAppId).HasColumnName("update_app_id");

                entity.Property(e => e.UpdateDate).HasColumnName("update_date");

                entity.Property(e => e.UpdateUserId).HasColumnName("update_user_id");

                entity.Property(e => e.VerticalTolerance).HasColumnName("vertical_tolerance");

                entity.Property(e => e.XOffset).HasColumnName("x_offset");

                entity.Property(e => e.YOffset).HasColumnName("y_offset");
            });

            modelBuilder.Entity<TgsTDProjectTargetPoint>(entity =>
            {
                entity.HasKey(e => e.Id0);

                entity.ToTable("TGS_T_D_ProjectTarget_Point");

                entity.Property(e => e.Id0)
                    .HasColumnName("id0")
                    .ValueGeneratedNever();

                entity.Property(e => e.CoordinateDown).HasColumnName("coordinate_down");

                entity.Property(e => e.CoordinateEast).HasColumnName("coordinate_east");

                entity.Property(e => e.CoordinateNorth).HasColumnName("coordinate_north");

                entity.Property(e => e.CoordinateTvd).HasColumnName("coordinate_tvd");

                entity.Property(e => e.CoordinateUp).HasColumnName("coordinate_up");

                entity.Property(e => e.GeoMapEasting).HasColumnName("geo_map_easting");

                entity.Property(e => e.GeoMapNorthing).HasColumnName("geo_map_northing");

                entity.Property(e => e.PointName).HasColumnName("point_name");

                entity.Property(e => e.PointType).HasColumnName("point_type");

                entity.Property(e => e.ProjectId).HasColumnName("project_id");

                entity.Property(e => e.ProjectTargetId).HasColumnName("project_target_id");

                entity.Property(e => e.SequenceNo).HasColumnName("sequence_no");

                entity.Property(e => e.TargetPointId).HasColumnName("target_point_id");
            });

            modelBuilder.Entity<TgsTDProjectTargetScenarioLink>(entity =>
            {
                entity.HasKey(e => e.Id0);

                entity.ToTable("TGS_T_D_ProjectTarget_ScenarioLink");

                entity.Property(e => e.Id0)
                    .HasColumnName("id0")
                    .ValueGeneratedNever();

                entity.Property(e => e.ProjectId).HasColumnName("project_id");

                entity.Property(e => e.ProjectTargetId).HasColumnName("project_target_id");

                entity.Property(e => e.ScenarioId).HasColumnName("scenario_id");

                entity.Property(e => e.WellId).HasColumnName("well_id");

                entity.Property(e => e.WellboreId).HasColumnName("wellbore_id");
            });

            modelBuilder.Entity<TgsTDProjectTargetSiteLink>(entity =>
            {
                entity.HasKey(e => e.Id0);

                entity.ToTable("TGS_T_D_ProjectTarget_SiteLink");

                entity.Property(e => e.Id0)
                    .HasColumnName("id0")
                    .ValueGeneratedNever();

                entity.Property(e => e.ProjectId).HasColumnName("project_id");

                entity.Property(e => e.ProjectTargetId).HasColumnName("project_target_id");

                entity.Property(e => e.SiteId).HasColumnName("site_id");
            });

            modelBuilder.Entity<TgsTDProjectTargetWblink>(entity =>
            {
                entity.HasKey(e => e.Id0);

                entity.ToTable("TGS_T_D_ProjectTarget_WBLink");

                entity.Property(e => e.Id0)
                    .HasColumnName("id0")
                    .ValueGeneratedNever();

                entity.Property(e => e.Azimuth).HasColumnName("azimuth");

                entity.Property(e => e.Inclination).HasColumnName("inclination");

                entity.Property(e => e.ProjectId).HasColumnName("project_id");

                entity.Property(e => e.ProjectTargetId).HasColumnName("project_target_id");

                entity.Property(e => e.SequenceNo).HasColumnName("sequence_no");

                entity.Property(e => e.WellId).HasColumnName("well_id");

                entity.Property(e => e.WellboreId).HasColumnName("wellbore_id");
            });

            modelBuilder.Entity<TgsTDProjectTargetWellLink>(entity =>
            {
                entity.HasKey(e => e.Id0);

                entity.ToTable("TGS_T_D_ProjectTarget_WellLink");

                entity.Property(e => e.Id0)
                    .HasColumnName("id0")
                    .ValueGeneratedNever();

                entity.Property(e => e.ProjectId).HasColumnName("project_id");

                entity.Property(e => e.ProjectTargetId).HasColumnName("project_target_id");

                entity.Property(e => e.WellId).HasColumnName("well_id");
            });

            modelBuilder.Entity<TgsTDSectionSurveyHeader>(entity =>
            {
                entity.HasKey(e => e.Id0);

                entity.ToTable("TGS_T_D_SectionSurveyHeader");

                entity.Property(e => e.Id0)
                    .HasColumnName("id0")
                    .ValueGeneratedNever();

                entity.Property(e => e.Company).HasColumnName("company");

                entity.Property(e => e.DefinitivePlan).HasColumnName("definitive_plan");

                entity.Property(e => e.Description).HasColumnName("description");

                entity.Property(e => e.Engineer).HasColumnName("engineer");

                entity.Property(e => e.InputValidat).HasColumnName("input_validat");

                entity.Property(e => e.Name).HasColumnName("name");

                entity.Property(e => e.ScanOffsetWellId).HasColumnName("scan_offset_well_id");

                entity.Property(e => e.ScanScope).HasColumnName("scan_scope");

                entity.Property(e => e.SectionSurveyId).HasColumnName("section_survey_id");

                entity.Property(e => e.SurveyId).HasColumnName("survey_id");

                entity.Property(e => e.SurveyToolId).HasColumnName("survey_tool_id");

                entity.Property(e => e.SurveyType).HasColumnName("survey_type");

                entity.Property(e => e.TieOnAzi).HasColumnName("tie_on_azi");

                entity.Property(e => e.TieOnDepth).HasColumnName("tie_on_depth");

                entity.Property(e => e.TieOnEw).HasColumnName("tie_on_ew");

                entity.Property(e => e.TieOnInc).HasColumnName("tie_on_inc");

                entity.Property(e => e.TieOnNs).HasColumnName("tie_on_ns");

                entity.Property(e => e.TieOnTvd).HasColumnName("tie_on_tvd");

                entity.Property(e => e.TieOnType).HasColumnName("tie_on_type");

                entity.Property(e => e.TieSurveyHeaderId).HasColumnName("tie_survey_header_id");

                entity.Property(e => e.TieWellboreId).HasColumnName("tie_wellbore_id");

                entity.Property(e => e.ValidatDogleg).HasColumnName("validat_dogleg");

                entity.Property(e => e.WellboreId).HasColumnName("wellbore_id");
            });

            modelBuilder.Entity<TgsTDSesmic>(entity =>
            {
                entity.HasKey(e => e.Id0);

                entity.ToTable("TGS_T_D_Sesmic");

                entity.Property(e => e.Id0)
                    .HasColumnName("id0")
                    .ValueGeneratedNever();

                entity.Property(e => e.Guid).HasColumnName("guid");

                entity.Property(e => e.Path).HasColumnName("path");
            });

            modelBuilder.Entity<TgsTDSite>(entity =>
            {
                entity.HasKey(e => e.Id0);

                entity.ToTable("TGS_T_D_SITE");

                entity.Property(e => e.Id0)
                    .HasColumnName("id0")
                    .ValueGeneratedNever();

                entity.Property(e => e.BlockName).HasColumnName("block_name");

                entity.Property(e => e.Convergence).HasColumnName("convergence");

                entity.Property(e => e.CoordType).HasColumnName("coord_type");

                entity.Property(e => e.CreateAppId).HasColumnName("create_app_id");

                entity.Property(e => e.CreateDate).HasColumnName("create_date");

                entity.Property(e => e.CreateUserId).HasColumnName("create_user_id");

                entity.Property(e => e.DefaultRigElevation).HasColumnName("default_rig_elevation");

                entity.Property(e => e.DistrictName).HasColumnName("district_name");

                entity.Property(e => e.ForesightError).HasColumnName("foresight_error");

                entity.Property(e => e.GeoLatitude).HasColumnName("geo_latitude");

                entity.Property(e => e.GeoLongitude).HasColumnName("geo_longitude");

                entity.Property(e => e.GeoOffsetEastLeaseLine).HasColumnName("geo_offset_east_lease_line");

                entity.Property(e => e.GeoOffsetNorthLeaseLine).HasColumnName("geo_offset_north_lease_line");

                entity.Property(e => e.IsFacility).HasColumnName("is_facility");

                entity.Property(e => e.IsFieldCenter).HasColumnName("is_field_center");

                entity.Property(e => e.IsProjectReadonly).HasColumnName("is_project_readonly");

                entity.Property(e => e.IsReadonly).HasColumnName("is_readonly");

                entity.Property(e => e.LateralError).HasColumnName("lateral_error");

                entity.Property(e => e.LocCountry).HasColumnName("loc_country");

                entity.Property(e => e.LocCounty).HasColumnName("loc_county");

                entity.Property(e => e.LocDivision).HasColumnName("loc_division");

                entity.Property(e => e.LocFedLeaseNo).HasColumnName("loc_fed_lease_no");

                entity.Property(e => e.LocLeaseCode).HasColumnName("loc_lease_code");

                entity.Property(e => e.LocRegion).HasColumnName("loc_region");

                entity.Property(e => e.LocState).HasColumnName("loc_state");

                entity.Property(e => e.LocationId).HasColumnName("location_id");

                entity.Property(e => e.MagCrustalDec).HasColumnName("mag_crustal_dec");

                entity.Property(e => e.MagCrustalDip).HasColumnName("mag_crustal_dip");

                entity.Property(e => e.MagCrustalTotal).HasColumnName("mag_crustal_total");

                entity.Property(e => e.MagTimeDec).HasColumnName("mag_time_dec");

                entity.Property(e => e.MagTimeDip).HasColumnName("mag_time_dip");

                entity.Property(e => e.MagTimeTotal).HasColumnName("mag_time_total");

                entity.Property(e => e.NorthType).HasColumnName("north_type");

                entity.Property(e => e.PermafrostThickness).HasColumnName("permafrost_thickness");

                entity.Property(e => e.ProjectId).HasColumnName("project_id");

                entity.Property(e => e.Remarks).HasColumnName("remarks");

                entity.Property(e => e.RoadDescription).HasColumnName("road_description");

                entity.Property(e => e.ScaleFactor).HasColumnName("scale_factor");

                entity.Property(e => e.SiteId).HasColumnName("site_id");

                entity.Property(e => e.SiteLocDesc).HasColumnName("site_loc_desc");

                entity.Property(e => e.SiteName).HasColumnName("site_name");

                entity.Property(e => e.SiteType).HasColumnName("site_type");

                entity.Property(e => e.StateDistrictNo).HasColumnName("state_district_no");

                entity.Property(e => e.TightGroupId).HasColumnName("tight_group_id");

                entity.Property(e => e.TimeZone).HasColumnName("time_zone");

                entity.Property(e => e.TimeZoneDescription).HasColumnName("time_zone_description");

                entity.Property(e => e.TopBoreholeRadius).HasColumnName("top_borehole_radius");

                entity.Property(e => e.UpdateAppId).HasColumnName("update_app_id");

                entity.Property(e => e.UpdateDate).HasColumnName("update_date");

                entity.Property(e => e.UpdateUserId).HasColumnName("update_user_id");

                entity.Property(e => e.XCoord).HasColumnName("x_coord");

                entity.Property(e => e.YCoord).HasColumnName("y_coord");
            });

            modelBuilder.Entity<TgsTDSlot>(entity =>
            {
                entity.HasKey(e => e.Id0);

                entity.ToTable("TGS_T_D_Slot");

                entity.Property(e => e.Id0)
                    .HasColumnName("id0")
                    .ValueGeneratedNever();

                entity.Property(e => e.CenterX).HasColumnName("centerX");

                entity.Property(e => e.CenterY).HasColumnName("centerY");

                entity.Property(e => e.CharStart).HasColumnName("charStart");

                entity.Property(e => e.Clockwise).HasColumnName("clockwise");

                entity.Property(e => e.ColStep).HasColumnName("colStep");

                entity.Property(e => e.Colnum).HasColumnName("colnum");

                entity.Property(e => e.CoordX).HasColumnName("coordX");

                entity.Property(e => e.CoordY).HasColumnName("coordY");

                entity.Property(e => e.IsEditName).HasColumnName("isEditName");

                entity.Property(e => e.Name).HasColumnName("name");

                entity.Property(e => e.NubByRow).HasColumnName("nubByRow");

                entity.Property(e => e.NumSlot).HasColumnName("numSlot");

                entity.Property(e => e.NumStart).HasColumnName("numStart");

                entity.Property(e => e.OffsetAngle).HasColumnName("offsetAngle");

                entity.Property(e => e.OffsetX).HasColumnName("offsetX");

                entity.Property(e => e.OffsetY).HasColumnName("offsetY");

                entity.Property(e => e.Rotation).HasColumnName("rotation");

                entity.Property(e => e.RowStep).HasColumnName("rowStep");

                entity.Property(e => e.Rownum).HasColumnName("rownum");

                entity.Property(e => e.SiteId).HasColumnName("site_id");

                entity.Property(e => e.SlotId).HasColumnName("Slot_id");

                entity.Property(e => e.SlotRadius).HasColumnName("slotRadius");

                entity.Property(e => e.SlotType).HasColumnName("slotType");

                entity.Property(e => e.SortByChar).HasColumnName("sortByChar");

                entity.Property(e => e.SortByNum).HasColumnName("sortByNum");
            });

            modelBuilder.Entity<TgsTDSlotData>(entity =>
            {
                entity.HasKey(e => e.Id0);

                entity.ToTable("TGS_T_D_SlotData");

                entity.Property(e => e.Id0)
                    .HasColumnName("id0")
                    .ValueGeneratedNever();

                entity.Property(e => e.SlotId).HasColumnName("Slot_id");
            });

            modelBuilder.Entity<TgsTDSlotTemplate>(entity =>
            {
                entity.HasKey(e => e.Id0);

                entity.ToTable("TGS_T_D_SlotTemplate");

                entity.Property(e => e.Id0)
                    .HasColumnName("id0")
                    .ValueGeneratedNever();

                entity.Property(e => e.CreateAppId).HasColumnName("create_app_id");

                entity.Property(e => e.CreateDate).HasColumnName("create_date");

                entity.Property(e => e.CreateUserId).HasColumnName("create_user_id");

                entity.Property(e => e.EwEdge).HasColumnName("ew_edge");

                entity.Property(e => e.IsNamedSlots).HasColumnName("is_named_slots");

                entity.Property(e => e.NameDirection).HasColumnName("name_direction");

                entity.Property(e => e.NsEdge).HasColumnName("ns_edge");

                entity.Property(e => e.NumColumns).HasColumnName("num_columns");

                entity.Property(e => e.NumRows).HasColumnName("num_rows");

                entity.Property(e => e.Orientation).HasColumnName("orientation");

                entity.Property(e => e.RadiusEdge).HasColumnName("radius_edge");

                entity.Property(e => e.RadiusSlot).HasColumnName("radius_slot");

                entity.Property(e => e.ShortName).HasColumnName("short_name");

                entity.Property(e => e.SiteId).HasColumnName("site_id");

                entity.Property(e => e.SlotNames).HasColumnName("slot_names");

                entity.Property(e => e.SlotRadius).HasColumnName("slot_radius");

                entity.Property(e => e.SpacingColumns).HasColumnName("spacing_columns");

                entity.Property(e => e.SpacingRows).HasColumnName("spacing_rows");

                entity.Property(e => e.StartNumber).HasColumnName("start_number");

                entity.Property(e => e.TemplateEast).HasColumnName("template_east");

                entity.Property(e => e.TemplateId).HasColumnName("template_id");

                entity.Property(e => e.TemplateName).HasColumnName("template_name");

                entity.Property(e => e.TemplateNorth).HasColumnName("template_north");

                entity.Property(e => e.UpdateAppId).HasColumnName("update_app_id");

                entity.Property(e => e.UpdateDate).HasColumnName("update_date");

                entity.Property(e => e.UpdateUserId).HasColumnName("update_user_id");
            });

            modelBuilder.Entity<TgsTDSurface>(entity =>
            {
                entity.HasKey(e => e.Id0);

                entity.ToTable("TGS_T_D_Surface");

                entity.Property(e => e.Id0)
                    .HasColumnName("id0")
                    .ValueGeneratedNever();

                entity.Property(e => e.Guid).HasColumnName("guid");

                entity.Property(e => e.Path).HasColumnName("path");

                entity.Property(e => e.Type).HasColumnName("type");
            });

            modelBuilder.Entity<TgsTDSurveyHeader>(entity =>
            {
                entity.HasKey(e => e.Id0);

                entity.ToTable("TGS_T_D_SurveyHeader");

                entity.Property(e => e.Id0)
                    .HasColumnName("id0")
                    .ValueGeneratedNever();

                entity.Property(e => e.AverageDogleg).HasColumnName("average_dogleg");

                entity.Property(e => e.AzimuthCorrection).HasColumnName("azimuth_correction");

                entity.Property(e => e.AzimuthReference).HasColumnName("azimuth_reference");

                entity.Property(e => e.BendAngle).HasColumnName("bend_angle");

                entity.Property(e => e.CaseId).HasColumnName("case_id");

                entity.Property(e => e.Company).HasColumnName("company");

                entity.Property(e => e.CreateAppId).HasColumnName("create_app_id");

                entity.Property(e => e.CreateDate).HasColumnName("create_date");

                entity.Property(e => e.CreateUserId).HasColumnName("create_user_id");

                entity.Property(e => e.DateEnd).HasColumnName("date_end");

                entity.Property(e => e.DefinitivePlan).HasColumnName("definitive_plan");

                entity.Property(e => e.DepthCorrection).HasColumnName("depth_correction");

                entity.Property(e => e.DepthReference).HasColumnName("depth_reference");

                entity.Property(e => e.Description).HasColumnName("description");

                entity.Property(e => e.DirectionalDifficultyIndex).HasColumnName("directional_difficulty_index");

                entity.Property(e => e.Engineer).HasColumnName("engineer");

                entity.Property(e => e.HeaderDate).HasColumnName("header_date");

                entity.Property(e => e.InclinationCorrection).HasColumnName("inclination_correction");

                entity.Property(e => e.InputValidat).HasColumnName("input_validat");

                entity.Property(e => e.InterferenceCorrection).HasColumnName("interference_correction");

                entity.Property(e => e.IsInterferenceApplied).HasColumnName("is_interference_applied");

                entity.Property(e => e.IsMerged).HasColumnName("is_merged");

                entity.Property(e => e.IsReadonly).HasColumnName("is_readonly");

                entity.Property(e => e.IsSagApplied).HasColumnName("is_sag_applied");

                entity.Property(e => e.IsStretchApplied)
                    .HasColumnName("is_stretch_applied")
                    .HasColumnType("BIT");

                entity.Property(e => e.MagneticInterference).HasColumnName("magnetic_interference");

                entity.Property(e => e.MaximumDlsDepth).HasColumnName("maximum_dls_depth");

                entity.Property(e => e.MaximumDlsValue).HasColumnName("maximum_dls_value");

                entity.Property(e => e.MdMax).HasColumnName("md_max");

                entity.Property(e => e.MdMin).HasColumnName("md_min");

                entity.Property(e => e.MergeInterval).HasColumnName("merge_interval");

                entity.Property(e => e.MergeSurveyIds).HasColumnName("merge_survey_ids");

                entity.Property(e => e.MergeToolIds).HasColumnName("merge_tool_ids");

                entity.Property(e => e.NumberMerged).HasColumnName("number_merged");

                entity.Property(e => e.OffsetWellId).HasColumnName("offset_well_id");

                entity.Property(e => e.OverrideReason).HasColumnName("override_reason");

                entity.Property(e => e.Phase).HasColumnName("phase");

                entity.Property(e => e.PolicyId).HasColumnName("policy_id");

                entity.Property(e => e.ProcessingOption).HasColumnName("processing_option");

                entity.Property(e => e.Remarks).HasColumnName("remarks");

                entity.Property(e => e.SagData).HasColumnName("sag_data");

                entity.Property(e => e.ScanOffsetWell).HasColumnName("scan_offset_well");

                entity.Property(e => e.SensorFromBit).HasColumnName("sensor_from_bit");

                entity.Property(e => e.StretchFactor)
                    .HasColumnName("stretch_factor")
                    .HasColumnType("float");

                entity.Property(e => e.StretchFormula).HasColumnName("stretch_formula");

                entity.Property(e => e.SurveyHeaderId).HasColumnName("survey_header_id");

                entity.Property(e => e.SurveyName).HasColumnName("survey_name");

                entity.Property(e => e.SurveyToolId).HasColumnName("survey_tool_id");

                entity.Property(e => e.SurveyType).HasColumnName("survey_type");

                entity.Property(e => e.TieOnDepth).HasColumnName("tie_on_depth");

                entity.Property(e => e.TieOnType).HasColumnName("tie_on_type");

                entity.Property(e => e.TieSurveyHeaderId).HasColumnName("tie_survey_header_id");

                entity.Property(e => e.TieWellboreId).HasColumnName("tie_wellbore_id");

                entity.Property(e => e.ToolFaceAngle).HasColumnName("tool_face_angle");

                entity.Property(e => e.Tortuosity).HasColumnName("tortuosity");

                entity.Property(e => e.UpdateAppId).HasColumnName("update_app_id");

                entity.Property(e => e.UpdateDate).HasColumnName("update_date");

                entity.Property(e => e.UpdateUserId).HasColumnName("update_user_id");

                entity.Property(e => e.ValidatDogleg).HasColumnName("validat_dogleg");

                entity.Property(e => e.VersionNo).HasColumnName("version_no");

                entity.Property(e => e.WellDesc).HasColumnName("well_desc");

                entity.Property(e => e.WellId).HasColumnName("well_id");

                entity.Property(e => e.WellboreId).HasColumnName("wellbore_id");
            });

            modelBuilder.Entity<TgsTDSurveyProgram>(entity =>
            {
                entity.HasKey(e => e.Id0);

                entity.ToTable("TGS_T_D_SurveyProgram");

                entity.Property(e => e.Id0)
                    .HasColumnName("id0")
                    .ValueGeneratedNever();

                entity.Property(e => e.Comments).HasColumnName("comments");

                entity.Property(e => e.CreateAppId).HasColumnName("create_app_id");

                entity.Property(e => e.CreateDate).HasColumnName("create_date");

                entity.Property(e => e.CreateUserId).HasColumnName("create_user_id");

                entity.Property(e => e.DefSurveyHeaderId).HasColumnName("def_survey_header_id");

                entity.Property(e => e.HoleSectGroupId).HasColumnName("hole_sect_group_id");

                entity.Property(e => e.IsOverride).HasColumnName("isOverride");

                entity.Property(e => e.MdBase).HasColumnName("md_base");

                entity.Property(e => e.MdTop).HasColumnName("md_top");

                entity.Property(e => e.NotInUse).HasColumnName("not_in_use");

                entity.Property(e => e.Phase).HasColumnName("phase");

                entity.Property(e => e.PolicyId).HasColumnName("policy_id");

                entity.Property(e => e.SequenceNo).HasColumnName("sequence_no");

                entity.Property(e => e.SurveyFrequency).HasColumnName("survey_frequency");

                entity.Property(e => e.SurveyHeaderId).HasColumnName("survey_header_id");

                entity.Property(e => e.SurveyProgramId).HasColumnName("survey_program_id");

                entity.Property(e => e.SurveyToolId).HasColumnName("survey_tool_id");

                entity.Property(e => e.TieWellboreId).HasColumnName("tie_wellbore_id");

                entity.Property(e => e.ToolHistDate).HasColumnName("tool_hist_date");

                entity.Property(e => e.UpdateAppId).HasColumnName("update_app_id");

                entity.Property(e => e.UpdateDate).HasColumnName("update_date");

                entity.Property(e => e.UpdateUserId).HasColumnName("update_user_id");

                entity.Property(e => e.WellId).HasColumnName("well_id");

                entity.Property(e => e.WellboreId).HasColumnName("wellbore_id");
            });

            modelBuilder.Entity<TgsTDSurveyScenario>(entity =>
            {
                entity.HasKey(e => e.Id0);

                entity.ToTable("TGS_T_D_SurveyScenario");

                entity.Property(e => e.Id0)
                    .HasColumnName("id0")
                    .ValueGeneratedNever();

                entity.Property(e => e.CreateAppId).HasColumnName("create_app_id");

                entity.Property(e => e.CreateDate).HasColumnName("create_date");

                entity.Property(e => e.CreateUserId).HasColumnName("create_user_id");

                entity.Property(e => e.DatumId).HasColumnName("datum_id");

                entity.Property(e => e.DefSurveyHeaderId).HasColumnName("def_survey_header_id");

                entity.Property(e => e.EffectiveDate).HasColumnName("effective_date");

                entity.Property(e => e.FormationInfluxGroupId).HasColumnName("formation_influx_group_id");

                entity.Property(e => e.FormationSegmentWidth).HasColumnName("formation_segment_width");

                entity.Property(e => e.FracGradientGroupId).HasColumnName("frac_gradient_group_id");

                entity.Property(e => e.IsAssemblyGroupUsed).HasColumnName("is_assembly_group_used");

                entity.Property(e => e.IsCo2Hazard).HasColumnName("is_co2_hazard");

                entity.Property(e => e.IsDisplayingPriorStims).HasColumnName("is_displaying_prior_stims");

                entity.Property(e => e.IsH2sHazard).HasColumnName("is_h2s_hazard");

                entity.Property(e => e.IsReadonly).HasColumnName("is_readonly");

                entity.Property(e => e.Name).HasColumnName("name");

                entity.Property(e => e.OriginalTubularDatumId).HasColumnName("original_tubular_datum_id");

                entity.Property(e => e.Phase).HasColumnName("phase");

                entity.Property(e => e.PorePressureGroupId).HasColumnName("pore_pressure_group_id");

                entity.Property(e => e.Remarks).HasColumnName("remarks");

                entity.Property(e => e.ScenarioId).HasColumnName("scenario_id");

                entity.Property(e => e.SurveyHeaderId).HasColumnName("survey_header_id");

                entity.Property(e => e.TempGradientGroupId).HasColumnName("temp_gradient_group_id");

                entity.Property(e => e.UpdateAppId).HasColumnName("update_app_id");

                entity.Property(e => e.UpdateDate).HasColumnName("update_date");

                entity.Property(e => e.UpdateUserId).HasColumnName("update_user_id");

                entity.Property(e => e.Version).HasColumnName("version");

                entity.Property(e => e.WellId).HasColumnName("well_id");

                entity.Property(e => e.WellboreId).HasColumnName("wellbore_id");
            });

            modelBuilder.Entity<TgsTDSurveyStation>(entity =>
            {
                entity.HasKey(e => e.Id0);

                entity.ToTable("TGS_T_D_SurveyStation");

                entity.HasIndex(e => e.SurveyHeaderId)
                    .HasName("survey_header");

                entity.Property(e => e.Id0)
                    .HasColumnName("id0")
                    .ValueGeneratedNever();

                entity.Property(e => e.CreateAppId).HasColumnName("create_app_id");

                entity.Property(e => e.CreateDate).HasColumnName("create_date");

                entity.Property(e => e.CreateUserId).HasColumnName("create_user_id");

                entity.Property(e => e.Dls).HasColumnName("DLS");

                entity.Property(e => e.Ew).HasColumnName("EW");

                entity.Property(e => e.GravAxialRaw).HasColumnName("grav_axial_raw");

                entity.Property(e => e.GravTran1Raw).HasColumnName("grav_tran1_raw");

                entity.Property(e => e.GravTran2Raw).HasColumnName("grav_tran2_raw");

                entity.Property(e => e.Gtf).HasColumnName("GTF");

                entity.Property(e => e.MagAxialRaw).HasColumnName("mag_axial_raw");

                entity.Property(e => e.MagTran1Raw).HasColumnName("mag_tran1_raw");

                entity.Property(e => e.MagTran2Raw).HasColumnName("mag_tran2_raw");

                entity.Property(e => e.Md).HasColumnName("MD");

                entity.Property(e => e.MethodId).HasColumnName("method_id");

                entity.Property(e => e.Ns).HasColumnName("NS");

                entity.Property(e => e.PlanMethod).HasColumnName("plan_method");

                entity.Property(e => e.ProjectId).HasColumnName("project_id");

                entity.Property(e => e.ProjectTargetId).HasColumnName("project_target_id");

                entity.Property(e => e.Remarks).HasColumnName("remarks");

                entity.Property(e => e.SequenceNo).HasColumnName("sequence_no");

                entity.Property(e => e.StationType).HasColumnName("station_type");

                entity.Property(e => e.SurveyDate).HasColumnName("survey_date");

                entity.Property(e => e.SurveyHeaderId).HasColumnName("survey_header_id");

                entity.Property(e => e.SurveyId).HasColumnName("survey_id");

                entity.Property(e => e.TurnRate).HasColumnName("turn_rate");

                entity.Property(e => e.Tvd).HasColumnName("TVD");

                entity.Property(e => e.UpdateAppId).HasColumnName("update_app_id");

                entity.Property(e => e.UpdateDate).HasColumnName("update_date");

                entity.Property(e => e.UpdateUserId).HasColumnName("update_user_id");

                entity.Property(e => e.VerticalSect).HasColumnName("vertical_sect");

                entity.Property(e => e.WellId).HasColumnName("well_id");

                entity.Property(e => e.WellboreId).HasColumnName("wellbore_id");
            });

            modelBuilder.Entity<TgsTDSurveytool>(entity =>
            {
                entity.HasKey(e => e.Id0);

                entity.ToTable("TGS_T_D_SURVEYTOOL");

                entity.Property(e => e.Id0)
                    .HasColumnName("id0")
                    .ValueGeneratedNever();

                entity.Property(e => e.AzimuthEwExclusion).HasColumnName("azimuth_ew_exclusion");

                entity.Property(e => e.CentralizationType).HasColumnName("centralization_type");

                entity.Property(e => e.ChecksumValue).HasColumnName("checksum_value");

                entity.Property(e => e.Correlate).HasColumnName("correlate");

                entity.Property(e => e.CostPerLength).HasColumnName("cost_per_length");

                entity.Property(e => e.CostPerRun).HasColumnName("cost_per_run");

                entity.Property(e => e.CreateAppId).HasColumnName("create_app_id");

                entity.Property(e => e.CreateDate).HasColumnName("create_date");

                entity.Property(e => e.CreateUserId).HasColumnName("create_user_id");

                entity.Property(e => e.CurrentStatus).HasColumnName("current_status");

                entity.Property(e => e.DefaultTool).HasColumnName("default_tool");

                entity.Property(e => e.DepthType).HasColumnName("depth_type");

                entity.Property(e => e.Description).HasColumnName("description");

                entity.Property(e => e.GyroReferenceType).HasColumnName("gyro_reference_type");

                entity.Property(e => e.GyroType).HasColumnName("gyro_type");

                entity.Property(e => e.InclinationCorrectionType).HasColumnName("inclination_correction_type");

                entity.Property(e => e.InclinationRangeMax).HasColumnName("inclination_range_max");

                entity.Property(e => e.InclinationRangeMin).HasColumnName("inclination_range_min");

                entity.Property(e => e.IsRangeLimited).HasColumnName("is_range_limited");

                entity.Property(e => e.IsReadonly).HasColumnName("is_readonly");

                entity.Property(e => e.IsSingleShot).HasColumnName("is_single_shot");

                entity.Property(e => e.MagneticIntegererferenceType).HasColumnName("magnetic_INTEGERerference_type");

                entity.Property(e => e.MagneticReferenceType).HasColumnName("magnetic_reference_type");

                entity.Property(e => e.MisalignmentType).HasColumnName("misalignment_type");

                entity.Property(e => e.NotInUse).HasColumnName("not_in_use");

                entity.Property(e => e.PolicyId).HasColumnName("policy_id");

                entity.Property(e => e.RangeComment).HasColumnName("range_comment");

                entity.Property(e => e.Remarks).HasColumnName("remarks");

                entity.Property(e => e.ReplacesTool).HasColumnName("replaces_tool");

                entity.Property(e => e.RevisionComment).HasColumnName("revision_comment");

                entity.Property(e => e.RevisionDate).HasColumnName("revision_date");

                entity.Property(e => e.RevisionNumber).HasColumnName("revision_number");

                entity.Property(e => e.RunningSpeed).HasColumnName("running_speed");

                entity.Property(e => e.SourceReference).HasColumnName("source_reference");

                entity.Property(e => e.SurveyToolId).HasColumnName("survey_tool_id");

                entity.Property(e => e.ToolApplication).HasColumnName("tool_application");

                entity.Property(e => e.ToolName).HasColumnName("tool_name");

                entity.Property(e => e.ToolParameters).HasColumnName("tool_parameters");

                entity.Property(e => e.ToolSubtype).HasColumnName("tool_subtype");

                entity.Property(e => e.ToolType).HasColumnName("tool_type");

                entity.Property(e => e.UpdateAppId).HasColumnName("update_app_id");

                entity.Property(e => e.UpdateDate).HasColumnName("update_date");

                entity.Property(e => e.UpdateUserId).HasColumnName("update_user_id");
            });

            modelBuilder.Entity<TgsTDTarget>(entity =>
            {
                entity.HasKey(e => e.Id0);

                entity.ToTable("TGS_T_D_Target");

                entity.Property(e => e.Id0)
                    .HasColumnName("id0")
                    .ValueGeneratedNever();

                entity.Property(e => e.ConfidenceLevel).HasColumnName("confidence_level");

                entity.Property(e => e.CoordType).HasColumnName("coord_type");

                entity.Property(e => e.DrillWellId).HasColumnName("drill_well_id");

                entity.Property(e => e.DrillWellboreId).HasColumnName("drill_wellbore_id");

                entity.Property(e => e.GeoLatitude).HasColumnName("geo_latitude");

                entity.Property(e => e.GeoLongitude).HasColumnName("geo_longitude");

                entity.Property(e => e.GeoMapEasting).HasColumnName("geo_map_easting");

                entity.Property(e => e.GeoMapNorthing).HasColumnName("geo_map_northing");

                entity.Property(e => e.GeoOffsetEastTarget).HasColumnName("geo_offset_east_target");

                entity.Property(e => e.GeoOffsetNorthTarget).HasColumnName("geo_offset_north_target");

                entity.Property(e => e.Hide).HasColumnName("hide");

                entity.Property(e => e.IsHorizontal).HasColumnName("is_horizontal");

                entity.Property(e => e.LeaseFel).HasColumnName("lease_fel");

                entity.Property(e => e.LeaseFnl).HasColumnName("lease_fnl");

                entity.Property(e => e.LockPenetration).HasColumnName("lockPenetration");

                entity.Property(e => e.Locked).HasColumnName("locked");

                entity.Property(e => e.MinWidth).HasColumnName("min_width");

                entity.Property(e => e.PenetrationAzimuth).HasColumnName("penetration_azimuth");

                entity.Property(e => e.PenetrationInclination).HasColumnName("penetration_inclination");

                entity.Property(e => e.PolarBearing).HasColumnName("polar_bearing");

                entity.Property(e => e.PolarRange).HasColumnName("polar_range");

                entity.Property(e => e.ProjectId).HasColumnName("project_id");

                entity.Property(e => e.TargetAzimuth).HasColumnName("target_azimuth");

                entity.Property(e => e.TargetDescription).HasColumnName("target_description");

                entity.Property(e => e.TargetGeometry).HasColumnName("target_geometry");

                entity.Property(e => e.TargetId).HasColumnName("target_id");

                entity.Property(e => e.TargetInclination).HasColumnName("target_inclination");

                entity.Property(e => e.TargetName).HasColumnName("target_name");

                entity.Property(e => e.TargetTvd).HasColumnName("target_tvd");

                entity.Property(e => e.TargetType).HasColumnName("target_type");
            });

            modelBuilder.Entity<TgsTDTargetInfo>(entity =>
            {
                entity.HasKey(e => e.Id0);

                entity.ToTable("TGS_T_D_TargetInfo");

                entity.Property(e => e.Id0)
                    .HasColumnName("id0")
                    .ValueGeneratedNever();

                entity.Property(e => e.ArcRadius).HasColumnName("arc_radius");

                entity.Property(e => e.DipAngle).HasColumnName("dip_angle");

                entity.Property(e => e.DipDirection).HasColumnName("dip_direction");

                entity.Property(e => e.EndArcAngle).HasColumnName("end_arc_angle");

                entity.Property(e => e.PieSlice).HasColumnName("pie_slice");

                entity.Property(e => e.PieSliceAzimuth).HasColumnName("pie_slice_azimuth");

                entity.Property(e => e.PieSliceBoundary).HasColumnName("pie_slice_boundary");

                entity.Property(e => e.Radius).HasColumnName("radius");

                entity.Property(e => e.RectLength).HasColumnName("rect_Length");

                entity.Property(e => e.RectWidth).HasColumnName("rect_width");

                entity.Property(e => e.RotationDirect).HasColumnName("rotation_direct");

                entity.Property(e => e.SemiMajor).HasColumnName("semi_major");

                entity.Property(e => e.SemiMinor).HasColumnName("semi_minor");

                entity.Property(e => e.StartArcAngle).HasColumnName("start_arc_angle");

                entity.Property(e => e.TargetId).HasColumnName("target_id");

                entity.Property(e => e.ThicknessDown).HasColumnName("thickness_down");

                entity.Property(e => e.ThicknessUp).HasColumnName("thickness_up");

                entity.Property(e => e.XOffset).HasColumnName("x_offset");

                entity.Property(e => e.YOffset).HasColumnName("y_offset");
            });

            modelBuilder.Entity<TgsTDTargetPolygon>(entity =>
            {
                entity.HasKey(e => e.Id0);

                entity.ToTable("TGS_T_D_TargetPolygon");

                entity.Property(e => e.Id0)
                    .HasColumnName("id0")
                    .ValueGeneratedNever();

                entity.Property(e => e.Down).HasColumnName("down");

                entity.Property(e => e.Name).HasColumnName("name");

                entity.Property(e => e.TargetId).HasColumnName("target_id");

                entity.Property(e => e.Up).HasColumnName("up");

                entity.Property(e => e.XCoord).HasColumnName("x_coord");

                entity.Property(e => e.XOffset).HasColumnName("x_offset");

                entity.Property(e => e.YCoord).HasColumnName("y_coord");

                entity.Property(e => e.YOffset).HasColumnName("y_offset");
            });

            modelBuilder.Entity<TgsTDTcolor>(entity =>
            {
                entity.HasKey(e => e.Id0);

                entity.ToTable("TGS_T_D_TCOLOR");

                entity.Property(e => e.Id0)
                    .HasColumnName("id0")
                    .ValueGeneratedNever();

                entity.Property(e => e.Color).HasColumnName("color");

                entity.Property(e => e.DepthTo).HasColumnName("depth_to");

                entity.Property(e => e.DpTcolorId).HasColumnName("dp_tcolor_id");

                entity.Property(e => e.MaxRadius).HasColumnName("max_radius");

                entity.Property(e => e.SequenceNo).HasColumnName("sequence_no");

                entity.Property(e => e.WellId).HasColumnName("well_id");

                entity.Property(e => e.WellboreId).HasColumnName("wellbore_id");
            });

            modelBuilder.Entity<TgsTDToolterm>(entity =>
            {
                entity.HasKey(e => e.Id0);

                entity.ToTable("TGS_T_D_TOOLTERM");

                entity.Property(e => e.Id0)
                    .HasColumnName("id0")
                    .ValueGeneratedNever();

                entity.Property(e => e.CFormula).HasColumnName("c_formula");

                entity.Property(e => e.CRange).HasColumnName("c_range");

                entity.Property(e => e.CUnits).HasColumnName("c_units");

                entity.Property(e => e.CValue).HasColumnName("c_value");

                entity.Property(e => e.MaxRange).HasColumnName("max_range");

                entity.Property(e => e.MinRange).HasColumnName("min_range");

                entity.Property(e => e.PolicyId).HasColumnName("policy_id");

                entity.Property(e => e.SequenceNo).HasColumnName("sequence_no");

                entity.Property(e => e.SurveyToolId).HasColumnName("survey_tool_id");

                entity.Property(e => e.TermName).HasColumnName("term_name");

                entity.Property(e => e.TieType).HasColumnName("tie_type");

                entity.Property(e => e.ToolTermId).HasColumnName("tool_term_id");

                entity.Property(e => e.VectorType).HasColumnName("vector_type");
            });

            modelBuilder.Entity<TgsTDVerticalSection>(entity =>
            {
                entity.HasKey(e => e.Id0);

                entity.ToTable("TGS_T_D_VerticalSection");

                entity.Property(e => e.Id0)
                    .HasColumnName("id0")
                    .ValueGeneratedNever();

                entity.Property(e => e.DefSurveyHeaderId).HasColumnName("def_survey_header_id");

                entity.Property(e => e.MdStart).HasColumnName("md_start");

                entity.Property(e => e.ProjectTargetId).HasColumnName("project_target_id");

                entity.Property(e => e.TvdStart).HasColumnName("tvd_start");

                entity.Property(e => e.VerticalSectionId).HasColumnName("vertical_section_id");

                entity.Property(e => e.VsAngle).HasColumnName("vs_angle");

                entity.Property(e => e.VsEast).HasColumnName("vs_east");

                entity.Property(e => e.VsNorth).HasColumnName("vs_north");

                entity.Property(e => e.VsaType).HasColumnName("vsa_type");

                entity.Property(e => e.VsoType).HasColumnName("vso_type");

                entity.Property(e => e.WellboreId).HasColumnName("wellbore_id");
            });

            modelBuilder.Entity<TgsTDWalk>(entity =>
            {
                entity.HasKey(e => e.Id0);

                entity.ToTable("TGS_T_D_Walk");

                entity.Property(e => e.Id0)
                    .HasColumnName("id0")
                    .ValueGeneratedNever();

                entity.Property(e => e.SequenceNo).HasColumnName("sequence_no");

                entity.Property(e => e.StartTvd).HasColumnName("start_tvd");

                entity.Property(e => e.SurveyHeaderId).HasColumnName("survey_header_id");

                entity.Property(e => e.WalkId).HasColumnName("walk_id");

                entity.Property(e => e.WalkRate).HasColumnName("walk_rate");

                entity.Property(e => e.WellId).HasColumnName("well_id");

                entity.Property(e => e.WellboreId).HasColumnName("wellbore_id");
            });

            modelBuilder.Entity<TgsTDWell>(entity =>
            {
                entity.HasKey(e => e.Id0);

                entity.ToTable("TGS_T_D_Well");

                entity.Property(e => e.Id0)
                    .HasColumnName("id0")
                    .ValueGeneratedNever();

                entity.Property(e => e.ActiveUiUnitsysId).HasColumnName("active_ui_unitsys_id");

                entity.Property(e => e.ApiNo).HasColumnName("api_no");

                entity.Property(e => e.Battery).HasColumnName("battery");

                entity.Property(e => e.BatteryDirections).HasColumnName("battery_directions");

                entity.Property(e => e.CompletionWellId).HasColumnName("completion_well_id");

                entity.Property(e => e.ConductorInstallDate).HasColumnName("conductor_install_date");

                entity.Property(e => e.Convergence).HasColumnName("convergence");

                entity.Property(e => e.CoordType).HasColumnName("coord_type");

                entity.Property(e => e.CreateAppId).HasColumnName("create_app_id");

                entity.Property(e => e.CreateDate).HasColumnName("create_date");

                entity.Property(e => e.CreateUserId).HasColumnName("create_user_id");

                entity.Property(e => e.DatumName).HasColumnName("datum_name");

                entity.Property(e => e.FieldName).HasColumnName("field_name");

                entity.Property(e => e.FieldNumber).HasColumnName("field_number");

                entity.Property(e => e.GeoDescription).HasColumnName("geo_description");

                entity.Property(e => e.GeoLatitude).HasColumnName("geo_latitude");

                entity.Property(e => e.GeoLongitude).HasColumnName("geo_longitude");

                entity.Property(e => e.GeoOffsetEast).HasColumnName("geo_offset_east");

                entity.Property(e => e.GeoOffsetNorth).HasColumnName("geo_offset_north");

                entity.Property(e => e.GeoOffsetReference).HasColumnName("geo_offset_reference");

                entity.Property(e => e.IsCo2Present)
                    .HasColumnName("is_co2_present")
                    .HasColumnType("BIT");

                entity.Property(e => e.IsH2sPresent)
                    .HasColumnName("is_h2s_present")
                    .HasColumnType("BIT");

                entity.Property(e => e.IsLakeDrilled)
                    .HasColumnName("is_lake_drilled")
                    .HasColumnType("BIT");

                entity.Property(e => e.IsLsaPresent)
                    .HasColumnName("is_lsa_present")
                    .HasColumnType("BIT");

                entity.Property(e => e.IsMultilateral)
                    .HasColumnName("is_multilateral")
                    .HasColumnType("BIT");

                entity.Property(e => e.IsOffshore).HasColumnName("is_offshore");

                entity.Property(e => e.IsPlatform).HasColumnName("is_platform");

                entity.Property(e => e.IsProjectReadonly)
                    .HasColumnName("is_project_readonly")
                    .HasColumnType("BIT");

                entity.Property(e => e.IsReadonly).HasColumnName("is_readonly");

                entity.Property(e => e.IsSubsea).HasColumnName("is_subsea");

                entity.Property(e => e.LaheeClass).HasColumnName("lahee_class");

                entity.Property(e => e.LakeHeight).HasColumnName("lake_height");

                entity.Property(e => e.LeaseType).HasColumnName("lease_type");

                entity.Property(e => e.LocCountry).HasColumnName("loc_country");

                entity.Property(e => e.LocCounty).HasColumnName("loc_county");

                entity.Property(e => e.LocState).HasColumnName("loc_state");

                entity.Property(e => e.MaaspA).HasColumnName("maasp_a");

                entity.Property(e => e.MaaspB).HasColumnName("maasp_b");

                entity.Property(e => e.MaaspC).HasColumnName("maasp_c");

                entity.Property(e => e.MaaspD).HasColumnName("maasp_d");

                entity.Property(e => e.PreviousWellName).HasColumnName("previous_well_name");

                entity.Property(e => e.PumperRoute).HasColumnName("pumper_route");

                entity.Property(e => e.Reason).HasColumnName("reason");

                entity.Property(e => e.RedrillNo).HasColumnName("redrill_no");

                entity.Property(e => e.RedrillPrevWellId).HasColumnName("redrill_prev_well_id");

                entity.Property(e => e.Remarks).HasColumnName("remarks");

                entity.Property(e => e.RoadDescription).HasColumnName("road_description");

                entity.Property(e => e.ScaleFactor).HasColumnName("scale_factor");

                entity.Property(e => e.SiteId).HasColumnName("site_id");

                entity.Property(e => e.SlotEw).HasColumnName("slot_ew");

                entity.Property(e => e.SlotName).HasColumnName("slot_name");

                entity.Property(e => e.SlotNs).HasColumnName("slot_ns");

                entity.Property(e => e.SlotRadialError).HasColumnName("slot_radial_error");

                entity.Property(e => e.SpudDate).HasColumnName("spud_date");

                entity.Property(e => e.TargetFormation).HasColumnName("target_formation");

                entity.Property(e => e.TightGroupId).HasColumnName("tight_group_id");

                entity.Property(e => e.UnitSetOnCreate).HasColumnName("unit_set_on_create");

                entity.Property(e => e.UpdateAppId).HasColumnName("update_app_id");

                entity.Property(e => e.UpdateDate).HasColumnName("update_date");

                entity.Property(e => e.UpdateUserId).HasColumnName("update_user_id");

                entity.Property(e => e.UseSlotAsReference).HasColumnName("use_slot_as_reference");

                entity.Property(e => e.UserDefined1).HasColumnName("user_defined_1");

                entity.Property(e => e.UserDefined10).HasColumnName("user_defined_10");

                entity.Property(e => e.UserDefined11).HasColumnName("user_defined_11");

                entity.Property(e => e.UserDefined12).HasColumnName("user_defined_12");

                entity.Property(e => e.UserDefined2).HasColumnName("user_defined_2");

                entity.Property(e => e.UserDefined3).HasColumnName("user_defined_3");

                entity.Property(e => e.UserDefined4).HasColumnName("user_defined_4");

                entity.Property(e => e.UserDefined5).HasColumnName("user_defined_5");

                entity.Property(e => e.UserDefined6).HasColumnName("user_defined_6");

                entity.Property(e => e.UserDefined7).HasColumnName("user_defined_7");

                entity.Property(e => e.UserDefined8).HasColumnName("user_defined_8");

                entity.Property(e => e.UserDefined9).HasColumnName("user_defined_9");

                entity.Property(e => e.UserDefinedDate1).HasColumnName("user_defined_date_1");

                entity.Property(e => e.UserDefinedDate2).HasColumnName("user_defined_date_2");

                entity.Property(e => e.UserDefinedDate3).HasColumnName("user_defined_date_3");

                entity.Property(e => e.UserDefinedDate4).HasColumnName("user_defined_date_4");

                entity.Property(e => e.UserDefinedDate5).HasColumnName("user_defined_date_5");

                entity.Property(e => e.WaterDepth).HasColumnName("water_depth");

                entity.Property(e => e.WellCommonName).HasColumnName("well_common_name");

                entity.Property(e => e.WellDesc).HasColumnName("well_desc");

                entity.Property(e => e.WellDescAlternate).HasColumnName("well_desc_alternate");

                entity.Property(e => e.WellDirections).HasColumnName("well_directions");

                entity.Property(e => e.WellGeometry).HasColumnName("well_geometry");

                entity.Property(e => e.WellId)
                    .IsRequired()
                    .HasColumnName("well_id");

                entity.Property(e => e.WellLegalName).HasColumnName("well_legal_name");

                entity.Property(e => e.WellNetInt).HasColumnName("well_net_int");

                entity.Property(e => e.WellOperator).HasColumnName("well_operator");

                entity.Property(e => e.WellOperatorOriginal).HasColumnName("well_operator_original");

                entity.Property(e => e.WellPurpose).HasColumnName("well_purpose");

                entity.Property(e => e.WellUwi).HasColumnName("well_uwi");

                entity.Property(e => e.WellUwiType).HasColumnName("well_uwi_type");

                entity.Property(e => e.WellWorkingInt).HasColumnName("well_working_int");

                entity.Property(e => e.WellheadDepth).HasColumnName("wellhead_depth");

                entity.Property(e => e.WrpAzimuth).HasColumnName("wrp_azimuth");

                entity.Property(e => e.WrpEw).HasColumnName("wrp_ew");

                entity.Property(e => e.WrpInclination).HasColumnName("wrp_inclination");

                entity.Property(e => e.WrpMd).HasColumnName("wrp_md");

                entity.Property(e => e.WrpNs).HasColumnName("wrp_ns");

                entity.Property(e => e.WrpOffset).HasColumnName("wrp_offset");

                entity.Property(e => e.WrpTvd).HasColumnName("wrp_tvd");
            });

            modelBuilder.Entity<TgsTDWellBasic>(entity =>
            {
                entity.HasKey(e => e.Id0);

                entity.ToTable("TGS_T_D_WellBasic");

                entity.HasIndex(e => e.Code)
                    .HasName("key_code")
                    .IsUnique();

                entity.Property(e => e.Id0)
                    .HasColumnName("id0")
                    .ValueGeneratedNever();

                entity.Property(e => e.ActualE).HasColumnName("actual_e");

                entity.Property(e => e.ActualN).HasColumnName("actual_n");

                entity.Property(e => e.ActualX).HasColumnName("actual_x");

                entity.Property(e => e.ActualY).HasColumnName("actual_y");

                entity.Property(e => e.Area).HasColumnName("area");

                entity.Property(e => e.Basin).HasColumnName("basin");

                entity.Property(e => e.BeginDrillDatetime)
                    .HasColumnName("begin_drill_datetime")
                    .HasColumnType("datetime");

                entity.Property(e => e.BenefitContract).HasColumnName("benefit_contract");

                entity.Property(e => e.Block).HasColumnName("block");

                entity.Property(e => e.Code).HasColumnName("code");

                entity.Property(e => e.CompleteDatetime)
                    .HasColumnName("complete_datetime")
                    .HasColumnType("datetime");

                entity.Property(e => e.CoordinateSystem).HasColumnName("coordinate_system");

                entity.Property(e => e.DepthZero).HasColumnName("depth_zero");

                entity.Property(e => e.Derrick).HasColumnName("derrick");

                entity.Property(e => e.DesignDepth).HasColumnName("design_depth");

                entity.Property(e => e.DesignE).HasColumnName("design_e");

                entity.Property(e => e.DesignN).HasColumnName("design_n");

                entity.Property(e => e.DesignObjStrata).HasColumnName("design_obj_strata");

                entity.Property(e => e.DesignStrata).HasColumnName("design_strata");

                entity.Property(e => e.DesignX).HasColumnName("design_x");

                entity.Property(e => e.DesignY).HasColumnName("design_y");

                entity.Property(e => e.DriftAz).HasColumnName("drift_az");

                entity.Property(e => e.DriftDis).HasColumnName("drift_dis");

                entity.Property(e => e.DrillContract).HasColumnName("drill_contract");

                entity.Property(e => e.DrillSuper).HasColumnName("drill_super");

                entity.Property(e => e.DrilledDepth).HasColumnName("drilled_depth");

                entity.Property(e => e.DrilledStrata).HasColumnName("drilled_strata");

                entity.Property(e => e.ElevKb).HasColumnName("elev_kb");

                entity.Property(e => e.ElogContract).HasColumnName("elog_contract");

                entity.Property(e => e.ElogSuper).HasColumnName("elog_super");

                entity.Property(e => e.EndDrillDatetime)
                    .HasColumnName("end_drill_datetime")
                    .HasColumnType("datetime");

                entity.Property(e => e.FirstStructure).HasColumnName("first_structure");

                entity.Property(e => e.GeoPosition).HasColumnName("geo_position");

                entity.Property(e => e.GeoSuper).HasColumnName("geo_super");

                entity.Property(e => e.LogContract).HasColumnName("log_contract");

                entity.Property(e => e.LogSuper).HasColumnName("log_super");

                entity.Property(e => e.Name).HasColumnName("name");

                entity.Property(e => e.Operator).HasColumnName("operator");

                entity.Property(e => e.OperatorMode).HasColumnName("operator_mode");

                entity.Property(e => e.Remark).HasColumnName("remark");

                entity.Property(e => e.SecondStructure).HasColumnName("second_structure");

                entity.Property(e => e.SecondStructureBelt).HasColumnName("second_structure_belt");

                entity.Property(e => e.SlPosition).HasColumnName("sl_position");

                entity.Property(e => e.Statute).HasColumnName("statute");

                entity.Property(e => e.StrPosition).HasColumnName("str_position");

                entity.Property(e => e.Style).HasColumnName("style");

                entity.Property(e => e.Type).HasColumnName("type");

                entity.Property(e => e.WaterDepth).HasColumnName("water_depth");

                entity.Property(e => e.WellHeadTieBack).HasColumnName("well_head_tie_back");
            });

            modelBuilder.Entity<TgsTDWellBore>(entity =>
            {
                entity.HasKey(e => e.Id0);

                entity.ToTable("TGS_T_D_WellBore");

                entity.Property(e => e.Id0)
                    .HasColumnName("id0")
                    .ValueGeneratedNever();

                entity.Property(e => e.IsRadioActive).HasColumnName("is_radio_active");

                entity.Property(e => e.IsSideTrack).HasColumnName("is_side_track");

                entity.Property(e => e.Latitude).HasColumnName("latitude");

                entity.Property(e => e.Longitude).HasColumnName("longitude");

                entity.Property(e => e.MapEast).HasColumnName("map_east");

                entity.Property(e => e.MapNorth).HasColumnName("map_north");

                entity.Property(e => e.OffsetEast).HasColumnName("offset_east");

                entity.Property(e => e.OffsetNorth).HasColumnName("offset_north");

                entity.Property(e => e.ParentWellboreId).HasColumnName("parent_wellbore_id");

                entity.Property(e => e.ParentWellboreName).HasColumnName("parent_wellbore_name");

                entity.Property(e => e.RadioActiveDepth).HasColumnName("radio_active_depth");

                entity.Property(e => e.Remark).HasColumnName("remark");

                entity.Property(e => e.WellId).HasColumnName("well_id");

                entity.Property(e => e.WellboreId).HasColumnName("wellbore_id");

                entity.Property(e => e.WellboreName).HasColumnName("wellbore_name");

                entity.Property(e => e.WellboreTypeId).HasColumnName("wellbore_type_id");
            });

            modelBuilder.Entity<TgsTDWellBoreType>(entity =>
            {
                entity.HasKey(e => e.Id0);

                entity.ToTable("TGS_T_D_WellBoreType");

                entity.Property(e => e.Id0)
                    .HasColumnName("id0")
                    .ValueGeneratedNever();

                entity.Property(e => e.ProjectId).HasColumnName("project_id");

                entity.Property(e => e.WellboreTypeCode).HasColumnName("wellbore_type_code");

                entity.Property(e => e.WellboreTypeColor).HasColumnName("wellbore_type_color");

                entity.Property(e => e.WellboreTypeId).HasColumnName("wellbore_type_id");

                entity.Property(e => e.WellboreTypeName).HasColumnName("wellbore_type_name");
            });

            modelBuilder.Entity<TgsTDWellDatum>(entity =>
            {
                entity.HasKey(e => e.Id0);

                entity.ToTable("TGS_T_D_WellDatum");

                entity.Property(e => e.Id0)
                    .HasColumnName("id0")
                    .ValueGeneratedNever();

                entity.Property(e => e.ContractorId).HasColumnName("contractor_id");

                entity.Property(e => e.CreateAppId).HasColumnName("create_app_id");

                entity.Property(e => e.CreateDate).HasColumnName("create_date");

                entity.Property(e => e.CreateUserId).HasColumnName("create_user_id");

                entity.Property(e => e.DateEstablished).HasColumnName("date_established");

                entity.Property(e => e.DatumDescription).HasColumnName("datum_description");

                entity.Property(e => e.DatumElevation).HasColumnName("datum_elevation");

                entity.Property(e => e.DatumError).HasColumnName("datum_error");

                entity.Property(e => e.DatumId).HasColumnName("datum_id");

                entity.Property(e => e.DatumName).HasColumnName("datum_name");

                entity.Property(e => e.DatumType).HasColumnName("datum_type");

                entity.Property(e => e.IsDefault)
                    .HasColumnName("is_default")
                    .HasColumnType("BIT");

                entity.Property(e => e.Phase).HasColumnName("phase");

                entity.Property(e => e.Remarks).HasColumnName("remarks");

                entity.Property(e => e.RigId).HasColumnName("rig_id");

                entity.Property(e => e.SequenceNo).HasColumnName("sequence_no");

                entity.Property(e => e.UpdateAppId).HasColumnName("update_app_id");

                entity.Property(e => e.UpdateDate).HasColumnName("update_date");

                entity.Property(e => e.UpdateUserId).HasColumnName("update_user_id");

                entity.Property(e => e.WellId).HasColumnName("well_id");
            });

            modelBuilder.Entity<TgsTDWellDatumDataSet>(entity =>
            {
                entity.HasKey(e => e.Id0);

                entity.ToTable("TGS_T_D_WellDatum_DataSet");

                entity.Property(e => e.Id0)
                    .HasColumnName("id0")
                    .ValueGeneratedNever();

                entity.Property(e => e.DataSetId).HasColumnName("dataSet_id");

                entity.Property(e => e.DatumnId).HasColumnName("datumn_id");

                entity.Property(e => e.ElevKb).HasColumnName("elev_kb");

                entity.Property(e => e.IsDefault).HasColumnName("is_default");

                entity.Property(e => e.Name).HasColumnName("name");
            });

            modelBuilder.Entity<TgsTDWellLocation>(entity =>
            {
                entity.HasKey(e => e.Id0);

                entity.ToTable("TGS_T_D_WellLocation");

                entity.Property(e => e.Id0)
                    .HasColumnName("id0")
                    .ValueGeneratedNever();

                entity.Property(e => e.Latitude).HasColumnName("latitude");

                entity.Property(e => e.LocationId).HasColumnName("location_id");

                entity.Property(e => e.Longitude).HasColumnName("longitude");

                entity.Property(e => e.MapEast).HasColumnName("map_east");

                entity.Property(e => e.MapNorth).HasColumnName("map_north");

                entity.Property(e => e.OffsetEast).HasColumnName("offset_east");

                entity.Property(e => e.OffsetNorth).HasColumnName("offset_north");

                entity.Property(e => e.SlotName).HasColumnName("slot_name");

                entity.Property(e => e.WellHeadType).HasColumnName("wellHead_Type");

                entity.Property(e => e.WellId).HasColumnName("well_id");
            });

            OnModelCreatingPartial(modelBuilder);
        }

        partial void OnModelCreatingPartial(ModelBuilder modelBuilder);
    }
}
